These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: JPA cascading delete for jointable only?
PostPosted: Tue Jan 12, 2010 1:28 pm 
Newbie

Joined: Mon May 25, 2009 8:13 am
Posts: 2
Hi,

I have one entity A and another U.

U references a collection of A through a join table:

@OneToMany(fetch = FetchType.EAGER)
@JoinTable(name="ua")
private Set<A> ua;

When trying to delete an instance of A, I understandably get a constraint violation exception from the database, as this instance is referenced through the above relationship.

Which would be the best way to automatically remove the rows from ua referencing A, when deleting an A?

Thanks in advance!

-dennis


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.