Hibernate version: 3.2.0.ga
If I define a relation
Code:
@ManyToOne(cascade=CascadeType.REMOVE)
when an instance of the POJO where is defined this relation is deleted, that produces a attempt to delete the target of the relation, which is the "parent" of the current POJO, that is a nonsense.
In this case, like that the "on delete cascade" of Oracle, the expected behaviour would rather be that deleting the target of the relation produces the destruction of all the instances of entities which have a foreign key of this target.
If I want to have this behaviour, I must define as much relations
Code:
@OneToMany(cascade=CascadeType.REMOVE)
in a POJO as this POJO has foireign keys
That can be very heavy, and a lot less flexible that to define this rule on each foreign key (as Oracle does).
I had posted this message on JRA forum, but the answer was "it's a user hibernate question"...