[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2048) Incomplete MappingException at org.hibernate.mapping.SimpleValue

Diego Pires Plentz (JIRA) noreply at atlassian.com
Mon Sep 4 15:19:24 EDT 2006


Incomplete MappingException at org.hibernate.mapping.SimpleValue
----------------------------------------------------------------

         Key: HHH-2048
         URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2048
     Project: Hibernate3
        Type: Improvement

    Versions: 3.2.0.cr4    
    Reporter: Diego Pires Plentz


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:
   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