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.