]
Diego Pires Plentz resolved HHH-2048.
-------------------------------------
Resolution: Fixed
Fix Version/s: 3.2.5
Incomplete MappingException at org.hibernate.mapping.SimpleValue
----------------------------------------------------------------
Key: HHH-2048
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2048
Project: Hibernate3
Issue Type: Improvement
Affects Versions: 3.2.0.cr4
Reporter: Diego Pires Plentz
Assignee: Diego Pires Plentz
Fix For: 3.2.5
Attachments: SimpleValue.java.patch
When a mapped class has a wrong type, an exception is throwed, but it doesnt say nothing
about what class/table is mapped wrongly.
public Type getType() throws MappingException {
if (typeName==null) {
throw new MappingException("No type name");
}
Type result = TypeFactory.heuristicType(typeName, typeParameters);
if (result==null) {
String msg = "Could not determine type for: " + typeName;
if(columns!=null && columns.size()>0) {
msg += ", for columns: " + columns;
}
throw new MappingException(msg);
}
return result;
}
Can become something like this...
public Type getType() throws MappingException {
if (typeName==null) {
throw new MappingException("No type name");
}
Type result = TypeFactory.heuristicType(typeName, typeParameters);
if (result==null) {
String msg = "Could not determine type for: " + typeName;
if(table != null){
msg += ", at table: " + table.getName();
}
if(columns!=null && columns.size()>0) {
msg += ", for columns: " + columns;
}
throw new MappingException(msg);
}
return result;
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: