-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Re reading a relationship.
PostPosted: Tue May 22, 2007 12:13 pm 
Senior
Senior

Joined: Mon Jul 24, 2006 8:43 am
Posts: 160
Hibernate version:
Annotations: Version: 3.2.0 CR1, 13.05.2006
Core: version 3.2 cr2, May 5, 2006
EntityManager: Version: 3.2.0.CR1, 13.05.2006

Hi,
How do I force the M side of a 1:M relationship to be read from the database?
I am using an application managed Entity Manager using an extended persistence context.

I have a 1:M relationship between Company and Employee.
company has the API getEmployee() which will return the in memory Employee reference.
I have hibernate.max_fetch_depth set to zero.

I wish to re read the number of employees from the database the company has.
When I do:
em.merge(company) and em.refresh(company)
Only the company is re read.

so how do I re read the number of employees?
Regards


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 22, 2007 6:52 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
@Cascade(CascadeType.REFRESH)

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.