There are 10 fields in my database. In those 4 fields, 1 field is hash_attr. hash_attr is basically signifies whether incoming row is same or not with the row stored in database. If it is same we don't need to update the database else we need to update.
Like :
Fields : 1 ( id ) - 1
2 ( name ) - John
3 ( type ) - Coach
4 ( attr_hash ) - calculated by java hashcode
Hashcode logic :
int code = (name+type).hashcode();
Idea of attr_hash is that for data we we will calculate the hashcode and if that hascode matches with attr_hash then I will not update the databse table because that row should be same.
I think two different String can have same hashcode according to this link if we are using object's hashcode method. So what should be my hashcode logic to ensure two different Strings cannot have same hashcode.
I hope question is clear.