11.09.07 в 12:17 Gene Wu в своём письме писал(а):

to support lazy load base on your code. Just change the order. Load the object before you close em(this is the context needed for lazy load).

EntityManagerFactory emf = Persistence.createEntityManagerFactory("pu1");
EntityManager em = emf.createEntityManager();
OrdersEntity order = em.find(OrdersEntity.class, .....);
System.out.println(order.getUser());
em.close();
emf.close();

Thanks,

Gene.

Thnx but this answer is _completely_ useless. I know that changing the order will fix that code. But my code are few times more complicated and requires passing of detached entities.
So i do need some solution for this except EAGER fetch.

--
Best Regards
Evgeny K. Shepelyuk

Reply via email to