File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Hibernate 2:Update objects which has List Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "Hibernate 2:Update objects which has List" Watch "Hibernate 2:Update objects which has List" New topic
Author

Hibernate 2:Update objects which has List

amit sharma
Ranch Hand

Joined: Jul 19, 2006
Posts: 129
I try to persist object which has collection List .I have 2 tables .Everything is working fine but problem is that when i update the object then the original values does not delete but instead hibernate set the value of index column and foreign key null.I want that hibernate delete that row.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16622

You need to use cascade-option of "delete-orphan" in order for it to delete, if you use "delete" it just nulls out the Foreign Key.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
 
subject: Hibernate 2:Update objects which has List
 
Threads others viewed
[Hibernate] Batch update returned unexpected row count
How to avoid returng null object after deleting an object from the list collection?
Hibernate Cache
[URLyBird] Should I use a business object or String[] in my Data class?
many-to-many relationship with annotation
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture