[jboss-user] [EJB 3.0] - Attached/managed entity identity

mike.meyer do-not-reply at jboss.com
Fri Jan 26 06:40:26 EST 2007


Hi,

I'm wondering if two attached/managed entities obtained from the same persistence context in two different ways are guaranteed to be equal by referential identity?

For example:
Let A and B be related.

  | A a = (A)em.find(...);
  | B b = (B)em.find(B.class, a.getB().getId());
  | 
  | assert(b.equals(a.getB());  
  | assert(b == a.getB());
  | 

The above example works on JBoss EJB3 RC9 i.e. Hibernate, but is it guaranteed by the specification? I could'nt find any clear statement about it.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006762#4006762

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006762



More information about the jboss-user mailing list