它不是。这是一个简单的例子:
def a0 = new Airport(name: 'Dulles').save()
def f0 = new Flight(number: '1000', airport: a0).save()
assert 1 == Airport.count()
assert 1 == Flight.count()
Airport.executeUpdate("delete Airport a where a.name = 'Dulles'")
产量(缩写):
Caused by: java.sql.SQLException: Integrity constraint violation FKB4318470B2E8D1BA table: FLIGHT in statement [delete from airport where name='Dulles']
at org.hsqldb.jdbc.Util.throwError(Unknown Source)
at org.hsqldb.jdbc.jdbcPreparedStatement.executeUpdate(Unknown Source)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
... 27 more
有一个未解决的 Hibernate 问题要求能够在此处的查询中指定级联。
这也备份在 Grails 邮件列表中。