openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From han hongfang <hanhongf...@gmail.com>
Subject Fwd: Should the object returned from query be the same object with the new created one before being persistent?
Date Mon, 16 May 2011 09:48:16 GMT
Hi all,

I add openjpa dev list into the loop as well. Looking forward to the
expertise comments from both communities.

---------- Forwarded message ----------
From: han hongfang <hanhongfang@gmail.com>
Date: Mon, May 16, 2011 at 5:27 PM
Subject: Should the object returned from query be the same object with the
new created one before being persistent?
To: dev@openejb.apache.org


Hi devs,

I'm looking for if EJB persistence spec has any word on the requirement of
object movie_in and movie_out (see code snippet below). Should they be
movie_in == movie_out or movie_in.equals(movie_out)?

           EntityManager em = getEntityManager();
           Movie movie_in = new Movie("MovieNameA", "DirectorNameA",
"DescriptionA");
           em.persist(movie_in);
           em.flush();
           Movie movie_out = (Movie) em.createQuery("select m from MOVIE m
where m.name = 'MovieNameA' ").getSingleResult();

I'm hunting in the ejb3.1 spec and persistence2.0 specs for a while, but
failed to find the requirement. Can someone give me a hint on this? Thanks
in advance.

-- 
Best regards,

Han Hong Fang (Janet)
hanhongfang AT apache.org





-- 
Best regards,

Han Hong Fang (Janet)
hanhongfang AT apache.org

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message