File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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!