-->
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: Cascade=REMOVE, DataIntegrityViolationException
PostPosted: Thu Apr 01, 2010 3:13 am 
Newbie

Joined: Thu Apr 01, 2010 2:52 am
Posts: 1
Hello,

i have searched many hours on google and on this forum but i didn't find a solution to my problem.
Here my two classes:

Dataset class
Code:
@Entity
public class Dataset{
...
@OneToMany(cascade={CascadeType.REMOVE})
public List<Annotation> getAnnotations(){
      return annotations;
}
}


Annotation class
Code:
@Entity
public class Annotation{
...
}


So it is an unidirectionnal relation, with one dataset having many annotations.

The thing is when i delete a dataset, it doesn't let me do that, and i receive a DataIntegrityViolationException.

So here my question: is it possible in this kind of relation, to delete all annotations associated to a dataset when this dataset is deleted?

Thank you very much

PS: I use Maven, so for Hibernate the plugin hibernate3-maven-plugin.


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.