Hi
This is what the specs have to say about this:
A client can
test whether two entity object references refer to the same entity object by using the
isIdentical method. Alternatively, if a client obtains two entity object references from the same home,
it can determine if they refer to the same entity by comparing their
primary keys using the equals
method Further Enterprise JavaBeans architecture does not specify �object equality� (i.e. use of the ==
operator) for entity object references. The result of comparing two object references using the
Java programming
language Object.equals(Object obj) method is unspecified. Performing the
Object.hashCode() method on two object references that represent the entity object is not guaranteed
to yield the same result.
As per me (1) and (3) are the correct answers so you retrieve the primary keys for the entity beans and compare the primary keys using equals method.
Thanks
Ravi
[ March 01, 2005: Message edited by: Ravindra Janapareddy ]