Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hibenate delete problem

 
jaisai vijay
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
only if you mapping in the parent table,you can delete it when you delete parent table record.
 
jaisai vijay
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic