Hibernate version: 3.1b
Hello,
I'm trying to call a contains method over a lazy set.
All my mapped classes belongs to ParentH class that implements the following methods:
Code:
public boolean equals(Object obj) {
if (obj == this) return true;
if ( !getClass().equals(obj.getClass()) ) return false;
ParentH pObj = (ParentH)obj;
return this.getId().equals(pObj.getId()) &&
this.getVersion().equals(pObj.getVersion());
}
public String toString() {
return getId().toString() + "-" + getVersion().toString() + "@" + getClass().getName();
}
public int hashCode() {
return toString().hashCode();
}
when I call the followin method:
Code:
public boolean isRoleSelected() {
return getUser().getCRoleSet().contains(getRole());
}
The result is always false.
Could someone help me please?
kiuma[/code]