Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] CascadeType and schema question

If I have a relationship, say a @OneToOne uni-directional, which has a CascadeType.REMOVE, the FK constraint in the generated schema does not include an ON DELETE CASCADE. So in this case the related entity will be deleted but there's no explicit schema backstop in the form of the ON DELETE CASCADE. 

The JPA spec (2.0 final) does not appear to address this, though to be fair it doesn't have a section specifying schema generation. 

In looking through Eclipselink  documentation I found @CascadeOnDelete which appears to do this.  

I'm surprised that this additional annotation is required.   ODC is part of SQL:2003.  Is this simply an oversight in the spec or is there good reason to have this be implementation specific?

-Noah

 

Back to the top