I have a form that let user enter values about address information.
I want to compare the values I get from user, with information stored into ADDRESS table in the database.
I have an entity class
public class Address {
private String gevernate;
private int homeNo;
private String neighborhood;
private String street;
}
which is represented as a table in the database called ADDRESS.
and I have a view object for this class which return all address values from db tabel
public static Address getAddress(Connection Con, long stdID) {
// select stamatment and result set object.
}
The problem I face is that the form may NOT contain all values of Address object, it may contains only 2 or three values, it’s specified at run time. How can I compare two objects ?
add an equals method to the class like this: