views:

708

answers:

1

I have a PurchaseEntity that has a Set inside. After doing entityManager.persist(purchaseEntity), purchaseEntity itself and purchaseItemEntity's are all saved to DB correctly.

But after that entityManager.persist(purchaseEntity) call, purchaseEntity.getItems() returns null.

Is this a normal behaviour of Hibernate provided entityManager.persist()?

Is there a way to keep the collection remain in the containing entity object after it's persisted?

A: 

No, that's not a normal behavior. Furthermore, this is most certainly not Hibernate's doing - it has to be something in your code. Can you post your source?

ChssPly76
Thank you for your answer. That gave me enough hints to figure out what was wrong with our code. Cheers. :-)
tim_wonil
Share the insights with others so that all can learn.
Nrj