[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3170) PersistentClass classname is not revealed in MappingException
Paul Benedict (JIRA)
noreply at atlassian.com
Sun Mar 9 15:43:33 EDT 2008
PersistentClass classname is not revealed in MappingException
-------------------------------------------------------------
Key: HHH-3170
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3170
Project: Hibernate3
Issue Type: Improvement
Affects Versions: 3.2.x, 3.3
Reporter: Paul Benedict
A typical exception from bad configuration is:
Caused by: org.hibernate.MappingException: Could not determine type for: java.util.Map, for columns: [org.hibernate.mapping.Column(name)]
Recommendation:
The "org.hibernate.cfg.Configuration" class should catch the exception and add the name of the offending PersistentClass. The class is held by the iterator.
Line 1100 improvement:
private void validate() throws MappingException {
Iterator iter = classes.values().iterator();
while ( iter.hasNext() ) {
PersistentClass pc = (PersistentClass) iter.next();
try {
pc.validate( mapping );
} catch(MappingException e) {
throw new MappingException(pc.getClassName(), e);
}
....
}
Otherwise, I find it incredibly difficult to find the offending class without a step debugger.
--
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.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list