HHH-7728 Adapt hashcode to equals method

This commit is contained in:
Thorsten Schäfer 2012-10-30 16:19:36 +01:00 committed by brmeyer
parent e66d98cd48
commit a4f99386fb
1 changed files with 8 additions and 1 deletions

View File

@ -330,7 +330,14 @@ public class Table implements RelationalModel, Serializable {
@Override
public int hashCode() {
return isQuoted() ? name.hashCode() : name.toLowerCase().hashCode();
final int prime = 31;
int result = 1;
result = prime * result
+ ((catalog == null) ? 0 : isCatalogQuoted() ? catalog.hashCode() : catalog.toLowerCase().hashCode());
result = prime * result + ((name == null) ? 0 : isQuoted() ? name.hashCode() : name.toLowerCase().hashCode());
result = prime * result
+ ((schema == null) ? 0 : isSchemaQuoted() ? schema.hashCode() : schema.toLowerCase().hashCode());
return result;
}
@Override