To me only the 1 is correct.
The following is an excerpt from
J2EE Tutorial
To determine if two entity beans are identical, the client can invoke the isIdentical method, or it can fetch and compare the beans's primary keys:
String key1 = (String)accta.getPrimaryKey();
String key2 = (String)acctb.getPrimaryKey();
if (key1.compareTo(key2) == 0)
System.out.println("equal");
So 1 is correct.
The JDK document mentions that It is not required that if two objects are unequal according to the equals(java.lang.Object) method, then calling the hashCode method on each of the two objects must produce distinct integer results.
Then 2 is incorrect
The 3 says that to find out the getPrimaryKey method from their respective entity bean class
However the respective entity bean class should be the EJB class implements the EntityBean interface other than the reference implements the EJBObject or EJBLocalObject. It does not have such a method called getPrimaryKey. The Bean class can get it from its entity context object.
I do not think this one is right.
The 4 does not make sense. The EntityBean class can call the getEJBObject() or getEJBLocalObject() to retrieve the reference. However if we have the reference object , we do not need the Handler. And there is no Handler for EJBLocalObject.
As far as we know I have to select 2 from 4 but I only have 1. I would bet they phrased the 3 incorrecly. What they wanted to say was getPrimaryKey method from the entity bean reference. Then I select 1 and 3 for this question.
That is my 2 cents
Thanks
Lin