aspose file tools*
The moose likes Object Relational Mapping and the fly likes Commit a transaction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Commit a transaction" Watch "Commit a transaction" New topic
Author

Commit a transaction

dina raj
Greenhorn

Joined: Dec 06, 2005
Posts: 17
My application contains a table, Cust which has a child CUST_IDENTIFIER.

The problem arises when we try to insert a customer who has data that creates a constriant violation in the CUST_IDENTIFIER but no issues in the cust table. Will modifying the hbm.xml file, solve this issue. I need to solve the issue so that when i save the CUST table it tells me that it cannot insert because the child table has a constraint violation (or an exception is thrown) . Instead now data is inserted into the child table but an exception is thrown when it tries the CUST_IDENTIFIER table. I need to solve this by modifying the hibernate files .

[ Edited to use code tags - Paul Sturrock ]
[ November 17, 2006: Message edited by: Paul Sturrock ]
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

Yes, try to put

inverse="true"

on the many side instead of the one side, and see what happens.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Commit a transaction