Maybe you have similar problem :)
Scenario: Lazy fetching & equality So the problem was that our component selectOneMenu
could not getSelected object and was returning no item selected But when I was trying to
display value by inputText or whatever the value was there? I was debugging MenuRenderer
and I was receiving null data values in object instance, what was the problem? Problem was
that our entity object was implementing equals method, but method was comparing
this.name().equals(country.name()) instead of this.getName().equals(country.getName()) as
a proxy object it just was not initialized and was not fetched, so getXXX forces hibernate
to fetch data
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (!(other instanceof Country)) {
return false;
}
final Country country = (Country) other;
if (this.getName() != null) {
return this.getName().equals(country.getName());
}
return false;
}
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079799#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...