This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: hibenate delete problem
 
Similar Threads
FOREIGN KEY
Delete from multiple tables.
binding two JTables to each other
how to retrieve values from more than two tables
Oracle table partitioning