fonseca,
No, id equality is not an absolute requirement.
Lets say you have a nationality dropdown; we'll call the objects looked up for
the dropdown v1, and the the objects looked up by the entity converter v2.
In the dropdown you select British as your nationality (which is Britishv1);
the
check for null in the equals()
I use an older version of the SelectItem.
When you have the 'noSelectionLabel' I think the equals is called with a null
as well (always return false when the parameter to equals is null
View the original post :
Thank you Peter, I seem to be getting to the problem now. I have a few Lists in
my entity, and it seems the problem lies within comparing them. When having a
this.somelist.equals(o.somelist) in my equals, wherever the lists are
equivalent or not, the result is always false, therefore generating
I guess it would be nice if JSF would let you implement your own equals via the
converter, that way we could automatically provide equality on the @Id property.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3989683#3989683
Reply to the post :
Hi Peter,
I understand that the equals in my Entity should be overridden as to prevent
the default comparison of instances, but is id equality a requirement somehow?
Currently, my equals does a value comparison of all fields in the Entity, save
for the id, and I'm still having the same error
I am also having a problem with this. I have it working for one entity, but I
get a jsf validation error for another. Both equals methods were generated
using Eclipse 3.2.
I cannot find the difference between the 2 entities. I will try the equals
method that only compares the ids.
View
I tried the following on the offending entity, but I still get a validation
error.
| @Override
| public boolean equals(Object obj)
| {
| final Size other = (Size) obj;
| if(other.getId()==id) return true;
| return false;
| }
|
Here is how I am using the
I stepped into org.jboss.seam.selectitems.jsf.EntityConverter and found that
the entities are in fact looked up correctly. If I select 3 items each lookup
works fine, but I am still getting the jsf validation error.
I am using myfaces 1.1.4, JBoss 4.0.4.GA and Seam 1.0.1 GA.
Any advice?
The EntityConverter reloads the Entity from the persistence context when
submitting using a different instance of your EntityManager. As a result the
objects aren't the same.
To get round this you have to use 'id equality' - override the equals method on
the Entity to return true if the ids
Thanks peter,
Now it's working fine.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3988447#3988447
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3988447
___
jboss-user mailing
10 matches
Mail list logo