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

hibenate delete problem

jaisai vijay
Ranch Hand

Joined: Dec 17, 2009
Posts: 70
Hi ,

I have parent Table tableA and I have a child table TableB.

If I want to delete record from TableA based on the primary key TableAID How Can I write HQL query for this scenario? The TableAID is foreign key in the child table.

Thanks,.
Lucene china
Greenhorn

Joined: Dec 24, 2009
Posts: 4
only if you mapping in the parent table,you can delete it when you delete parent table record.


the sun is shunning,never give up.Go
jaisai vijay
Ranch Hand

Joined: Dec 17, 2009
Posts: 70
Hi,

Thanks for your reply I solved it by doing the mapping in the parent table. I had to map as one to many.

 
Consider Paul's rocket mass heater.
 
subject: hibenate delete problem