HHH-7728 Add equals method in the table class
This commit is contained in:
parent
73bae00c1c
commit
980554f97a
|
@ -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() ) {
|
||||
|
|
Loading…
Reference in New Issue