diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/Table.java b/hibernate-core/src/main/java/org/hibernate/mapping/Table.java index be8131bf1d..37e4516b80 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/Table.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/Table.java @@ -328,6 +328,27 @@ public class Table implements RelationalModel, Serializable { && uniqueKey.getColumns().containsAll( primaryKey.getColumns() ); } + @Override + public int hashCode() { + return isQuoted() ? name.hashCode() : name.toLowerCase().hashCode(); + } + + @Override + public boolean equals(Object object) { + return object instanceof Table && equals((Table) object); + } + + public boolean equals(Table table) { + if (null == table) { + return false; + } + if (this == table) { + return true; + } + + return isQuoted() ? name.equals(table.getName()) : name.equalsIgnoreCase(table.getName()); + } + public void validateColumns(Dialect dialect, Mapping mapping, TableMetadata tableInfo) { Iterator iter = getColumnIterator(); while ( iter.hasNext() ) {