Yap,
That is known, I usually override the 'equals' method,
For instance, with entities, I usually do the comparation with the ID of the entity such as:
class MyEntity {
...
private long id;
@Id
public long getId() {
return id;
}
...
@Override
public boolean equals(Object obj) {
if (obj instanceof MyEntity) {
MyEntity entity = (MyEntity) obj;
return this.id== entity.getId();
} else {
return false;
}
}
}
Asaf.
[Message sent by forum member 'trouby' (trouby)]
http://forums.java.net/jive/thread.jspa?messageID=210538