Improved mesage in Exception from Table.validateColumns
Description
The method validateColumns in Table throws an exception when it encounters a missing column. Each time I encounter this problem, I have to start the debugger and create a breakpoint to identify the which table that has the missing column.
So instead of:
if ( columnInfo == null ) { throw new HibernateException( "Missing column: " + col.getName() ); }
Add proper context to the Exception:
if ( columnInfo == null ) { throw new HibernateException( "Table:"+this+has " missing column: " + col.getName() ); }
This will make it trivial to identify and correct the bogus mapping or schema.
Activity
Steve EbersoleMarch 21, 2011 at 7:04 PM
Bulk closing stale resolved issues
Diego PlentzAugust 15, 2007 at 4:01 PM
Already done.
if ( columnInfo == null ) { throw new HibernateException( "Missing column: " + col.getName() + " in " + Table.qualify( tableInfo.getCatalog(), tableInfo.getSchema(), tableInfo.getName())); }
The method validateColumns in Table throws an exception when it encounters a missing column. Each time I encounter this problem, I have to start the debugger and create a breakpoint to identify the which table that has the missing column.
So instead of:
if ( columnInfo == null ) {
throw new HibernateException( "Missing column: " + col.getName() );
}
Add proper context to the Exception:
if ( columnInfo == null ) {
throw new HibernateException( "Table:"+this+has " missing column: " + col.getName() );
}
This will make it trivial to identify and correct the bogus mapping or schema.