-->
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.  [ 1 post ] 
Author Message
 Post subject: Some time collections come empty
PostPosted: Fri Jun 22, 2007 8:48 am 
Newbie

Joined: Thu May 24, 2007 2:48 am
Posts: 1
Hibernate version: 3.2

I have two entites like One is PurchaseOrder & OrderLineItems. PurchaseOrder contains List of OrderLineItems with OneToMany relationship. I haven't specified any FetchType attribute to this mapping. Though there is a correct data in database some time the List of OrderLineitem comes Empty.

The mapping code I have written is

Code in PurchaseOrder Entity

@OneToMany (cascade = CascadeType.ALL,mappedBy = "purchaseOrder")
private List<OrderLineItem> lineItem;

Code in OrderLineItem Entity

@ManyToOne
private PurchaseOrder purchaseOrder;

But if i specify the FetchType= EAGER then the List will be Populated.

Please help me to resolve this issue.

Thanks in advance,
Amit

_________________
AMIT SOLANKURKAR


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

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.