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.

Environment

None

Activity

Show:
Max Rydahl Andersen
June 9, 2006, 9:10 AM

add a patch and it will be done faster

Diego Plentz
August 15, 2007, 4:01 PM

Already done.

if ( columnInfo == null ) {
throw new HibernateException( "Missing column: " + col.getName() + " in " + Table.qualify( tableInfo.getCatalog(), tableInfo.getSchema(), tableInfo.getName()));
}

Steve Ebersole
March 21, 2011, 7:04 PM

Bulk closing stale resolved issues

Cannot Reproduce

Assignee

Diego Plentz

Reporter

BjørnB

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Minor
Configure