Because of the call to String.toLowerCase() without a locale in TableMetadata.addColumn(ResultSet), the name of a column can be incorrectly set when the default locale is Turkish.
Example:
the original column name is "id",
in addColumn(ResultSet), the name becomes ıd (note the first character is 'ı' (U+0131) instead of 'i' (U+0069) because of the String.toLowerCase() in line 154),
as a result, the construction of the SessionFactory fails with a HibernateException:
org.hibernate.HibernateException: Missing column: id in ELEMENT
HHH-8579
in 4.2.7, it might be possible to fix the problem by switching the direct call to String.toLowerCase() by StringHelper.toLowerCase(String); i.e. from:
if ( getColumnMetadata(column) == null ) {
ColumnMetadata info = new ColumnMetadata(rs);
columns.put( info.getName().toLowerCase(), info );
}
to:
if ( getColumnMetadata(column) == null ) {
ColumnMetadata info = new ColumnMetadata(rs);
columns.put( StringHelper.toLowerCase(info.getName()), info );
}