I'm using Oracle 10g, and I have a table setup similar to the following:
Code:
CREATE TABLE parent ( parent_id NUMBER PRIMARY KEY );
CREATE TABLE child ( child_id NUMBER PRIMARY KEY, parent_id NUMBER NOT NULL REFERENCES parent ON DELETE CASCADE );
So if I have this:
Code:
class Parent {
@Id private Long id;
@OneToMany( mappedBy="parent", cascade=CascadeType.EVICT ) private Set<Child> children;
}
and this:
Code:
class Child {
@Id private Long id;
@ManyToOne @JoinColumn( name="parent_id", nullable=false ) private Long parentId;
}
will hibernate OMIT the child delete statements? I'd rather have the database handle the cascading where possible, rather than Hibernate. Is this what EVICT does?
Thanks!