Author: d.plentz
Date: 2007-09-29 13:20:17 -0400 (Sat, 29 Sep 2007)
New Revision: 14035
Modified:
core/trunk/core/src/main/java/org/hibernate/mapping/Table.java
Log:
[HHH-2852] Better error messages when schema validation fails
Modified: core/trunk/core/src/main/java/org/hibernate/mapping/Table.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/mapping/Table.java 2007-09-29 17:18:42 UTC
(rev 14034)
+++ core/trunk/core/src/main/java/org/hibernate/mapping/Table.java 2007-09-29 17:20:17 UTC
(rev 14035)
@@ -259,8 +259,11 @@
|| columnInfo.getTypeCode() == col.getSqlTypeCode( mapping );
if ( !typesMatch ) {
throw new HibernateException(
- "Wrong column type: " + col.getName() +
- ", expected: " + col.getSqlType( dialect, mapping )
+ "Wrong column type in " +
+ Table.qualify( tableInfo.getCatalog(), tableInfo.getSchema(), tableInfo.getName())
+
+ " for column " + col.getName() +
+ ". Found: " + columnInfo.getTypeName().toLowerCase() +
+ ", expected: " + col.getSqlType( dialect, mapping )
);
}
}