users@glassfish.java.net

Re: UISelectMany and POJOs: "Value Is Not Valid"

From: <glassfish_at_javadesktop.org>
Date: Thu, 29 Mar 2007 17:38:15 PST

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