1 package org
.codehaus
.groovy
.grails
.orm
.hibernate
;
4 import org
.hibernate
.FlushMode
;
6 class ValidationFailureTests
extends AbstractGrailsHibernateTests
{
11 class ValidationFailureBook {
16 class ValidationFailureAuthor {
21 static hasMany = [books: ValidationFailureBook]
22 static constraints = {
31 void testValidationFailure() {
32 def authorClass
= ga
.getDomainClass("ValidationFailureAuthor")
33 def bookClass
= ga
.getDomainClass("ValidationFailureBook")
35 def a
= authorClass
.newInstance()
38 def b1
= bookClass
.newInstance()
41 def b2
= bookClass
.newInstance()
47 assert session
.contains(a
)
57 a
= authorClass
.clazz
.get(1)
63 assertTrue FlushMode
.isManualFlushMode(session
.getFlushMode())