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
|