This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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

JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "hibenate delete problem" Watch "hibenate delete problem" New topic

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.

Lucene china

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

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

I agree. Here's the link:
subject: hibenate delete problem
It's not a secret anymore!