[Hibernate-JIRA] Created: (HHH-5065) Exception thrown by Configuration.getRootClassMapping(String) not helpful
by Stefan Fussenegger (JIRA)
Exception thrown by Configuration.getRootClassMapping(String) not helpful
-------------------------------------------------------------------------
Key: HHH-5065
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5065
Project: Hibernate Core
Issue Type: Improvement
Affects Versions: 3.3.2
Environment: hibernate-core-3.3.2.GA.jar
Reporter: Stefan Fussenegger
Priority: Trivial
current code:
{code:java}
RootClass getRootClassMapping(String clazz) throws MappingException {
try {
return (RootClass) getClassMapping( clazz );
}
catch (ClassCastException cce) {
throw new MappingException( "You may only specify a cache for root <class> mappings" );
}
}
{code}
this causes exception message to be "You may only specify a cache for root <class> mappings". As a result, the user will have to check all cache configurations or set a breakpoint to get the value of {{clazz}} that caused the error. To simplify this process, add {{clazz}} to the message, e.g. {{"You may only specify a cache for root <class> mappings, was " + clazz}}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 8 months