Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Generate entities with cascade delete
PostPosted: Mon Oct 03, 2016 1:47 pm 
Newbie

Joined: Tue Feb 23, 2016 1:04 pm
Posts: 11
I am generating entities for our large database via hibernate reverse engineering. I was hoping to see cascade annotations in entities, but did not see them on generation.

Is there a way to direct hibernate to consider foreign keys and generate entities with cascade annotations, so that when i delete a parent all associated entities get automatically deleted.

Basically, I do not want to delete all associated entities & their associations one by one as its a very cumbersome task ; can hibernate reverse engineering help here?


Top
 Profile  
 
 Post subject: Re: Generate entities with cascade delete
PostPosted: Wed Nov 02, 2016 10:11 pm 
Newbie

Joined: Tue Feb 23, 2016 1:04 pm
Posts: 11
Does anybody have any ideas on this?


Top
 Profile  
 
 Post subject: Re: Generate entities with cascade delete
PostPosted: Thu Nov 03, 2016 1:41 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1530
Check out this StackOverflow answer.

_________________
If you liked my answer, you are going to love my High-Performance Java Persistence book and my blog as well.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.