@Test public void testEquals() throws Exception { ForeignKeyDesc foreignKeyDesc = new ForeignKeyDesc(); foreignKeyDesc.addColumnName("AAA"); foreignKeyDesc.setReferencedCatalogName("BBB"); foreignKeyDesc.setReferencedSchemaName("CCC"); foreignKeyDesc.setReferencedTableName("DDD"); foreignKeyDesc.addReferencedColumnName("EEE"); ForeignKeyDesc foreignKeyDesc2 = new ForeignKeyDesc(); foreignKeyDesc2.addColumnName("aaa"); foreignKeyDesc2.setReferencedCatalogName("bbb"); foreignKeyDesc2.setReferencedSchemaName("ccc"); foreignKeyDesc2.setReferencedTableName("ddd"); foreignKeyDesc2.addReferencedColumnName("eee"); ForeignKeyDesc foreignKeyDesc3 = new ForeignKeyDesc(); foreignKeyDesc3.addColumnName("XXX"); assertEquals(foreignKeyDesc, foreignKeyDesc2); assertEquals(foreignKeyDesc.hashCode(), foreignKeyDesc2.hashCode()); Assert.assertNotEquals(foreignKeyDesc, foreignKeyDesc3); Assert.assertNotEquals(foreignKeyDesc.hashCode(), foreignKeyDesc3 .hashCode()); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ForeignKeyDesc other = (ForeignKeyDesc) obj; return key.equals(other.key); }
ForeignKeyDesc { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ForeignKeyDesc other = (ForeignKeyDesc) obj; return key.equals(other.key); } }
ForeignKeyDesc { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ForeignKeyDesc other = (ForeignKeyDesc) obj; return key.equals(other.key); }  }
ForeignKeyDesc { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ForeignKeyDesc other = (ForeignKeyDesc) obj; return key.equals(other.key); }  List<String> getColumnNameList(); void addColumnName(String columnName); String getReferencedCatalogName(); void setReferencedCatalogName(String referencedCatalogName); String getReferencedSchemaName(); void setReferencedSchemaName(String referencedSchemaName); String getReferencedTableName(); void setReferencedTableName(String referencedTableName); List<String> getReferencedColumnNameList(); void addReferencedColumnName(String referencedColumnName); void setReferencedFullTableName(String referencedFullTableName); String getReferencedFullTableName(); ReferentialActionType getOnDelete(); void setOnDelete(ReferentialActionType onDelete); ReferentialActionType getOnUpdate(); void setOnUpdate(ReferentialActionType onUpdate); @Override int hashCode(); @Override boolean equals(Object obj); }
ForeignKeyDesc { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ForeignKeyDesc other = (ForeignKeyDesc) obj; return key.equals(other.key); }  List<String> getColumnNameList(); void addColumnName(String columnName); String getReferencedCatalogName(); void setReferencedCatalogName(String referencedCatalogName); String getReferencedSchemaName(); void setReferencedSchemaName(String referencedSchemaName); String getReferencedTableName(); void setReferencedTableName(String referencedTableName); List<String> getReferencedColumnNameList(); void addReferencedColumnName(String referencedColumnName); void setReferencedFullTableName(String referencedFullTableName); String getReferencedFullTableName(); ReferentialActionType getOnDelete(); void setOnDelete(ReferentialActionType onDelete); ReferentialActionType getOnUpdate(); void setOnUpdate(ReferentialActionType onUpdate); @Override int hashCode(); @Override boolean equals(Object obj);  }