File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes CascadeType.PERSIST not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "CascadeType.PERSIST not working" Watch "CascadeType.PERSIST not working" New topic

CascadeType.PERSIST not working

Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 608

Hi Guys..

Could someone please point out to me where I might be going wrong?I'm trying to make sure that when an Item is persisted it's bids get persisted as well...I am using this property in my persistence.xml:

At the moment I can persist a bid or an item but persisting an Item will only result in an Item being added to the item table,not it's related Bids..
I have the following two entities(modified from the ActionBazaar app):

And finally the entity manager code(in my bean's business method):

===>SCJP 1.5(72%)<===
I agree. Here's the link:
subject: CascadeType.PERSIST not working
It's not a secret anymore!