GRAILS-1019: Allowing expressions to be used with the 'disabled' attribute for g...
[grails.git] / test / groovy / org / codehaus / groovy / grails / orm / hibernate / ExplicitInsertWithSaveMethodTests.groovy
blob804997165aeafbf21fb60c65e5553bb4200d6592
1 package org.codehaus.groovy.grails.orm.hibernate
2 /**
3 * @author Graeme Rocher
4 * @since 1.0
5 *
6 * Created: Mar 14, 2008
7 */
8 class ExplicitInsertWithSaveMethodTests extends AbstractGrailsHibernateTests {
10 protected void onSetUp() {
11 gcl.parseClass '''
12 class ExplicitInsertTest {
13 Long id
14 Long version
15 String name
17 '''
20 void testExplicitInsert() {
21 def test = ga.getDomainClass("ExplicitInsertTest").newInstance()
23 test.name = "Foo"
25 assert test.save(insert:true, flush:true)
27 session.clear()
29 test = ga.getDomainClass("ExplicitInsertTest").clazz.get(1)
31 assert test
33 test.name = "Bar"
34 test.save(insert:true, flush:true)