openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Evgeny Shepelyuk" <eshepel...@gmail.com>
Subject Re: Lazy load for detached entities
Date Tue, 11 Sep 2007 09:59:25 GMT
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

Mime
View raw message