Fix SecondaryTableTest

This commit is contained in:
Andrea Boriero 2016-04-22 22:08:38 +01:00 committed by Steve Ebersole
parent 7b107539db
commit 4b2e96c6e9
1 changed files with 14 additions and 6 deletions

View File

@ -6,6 +6,8 @@
*/
package org.hibernate.test.annotations.filter.secondarytable;
import org.hibernate.Session;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Assert;
import org.junit.Test;
@ -19,12 +21,18 @@ public class SecondaryTableTest extends BaseCoreFunctionalTestCase {
@Override
protected void prepareTest() throws Exception {
openSession();
insertUser("q@s.com", 21, false, "a1", "b");
insertUser("r@s.com", 22, false, "a2", "b");
insertUser("s@s.com", 23, true, "a3", "b");
insertUser("t@s.com", 24, false, "a4", "b");
session.flush();
Session s = openSession();
s.beginTransaction();
try {
insertUser( "q@s.com", 21, false, "a1", "b" );
insertUser( "r@s.com", 22, false, "a2", "b" );
insertUser( "s@s.com", 23, true, "a3", "b" );
insertUser( "t@s.com", 24, false, "a4", "b" );
session.flush();
s.getTransaction().commit();
}catch (Exception e){
s.getTransaction().rollback();
}
}
@Test