HHH-11037 : Fix tests to be jdk6-compliant
(cherry picked from commit 840258a00e
)
This commit is contained in:
parent
2335716be8
commit
9ad8e1ae88
|
@ -32,11 +32,10 @@ import java.util.Set;
|
|||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate;
|
||||
|
||||
/**
|
||||
* @author Andrea Boriero
|
||||
*/
|
||||
|
@ -49,23 +48,29 @@ public class JoinedSubclassWithEmbeddableTest extends BaseCoreFunctionalTestCase
|
|||
|
||||
@Test
|
||||
public void testSelectFromEmbeddedField() {
|
||||
doInHibernate( this::sessionFactory, session -> {
|
||||
session.createNativeQuery( "select * from employee_embeddable_person_map" ).getResultList();
|
||||
} );
|
||||
Session session = openSession();
|
||||
session.getTransaction().begin();
|
||||
session.createSQLQuery( "select * from employee_embeddable_person_map" ).list();
|
||||
session.getTransaction().commit();
|
||||
session.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSelectFromSubclass() {
|
||||
doInHibernate( this::sessionFactory, session -> {
|
||||
session.createNativeQuery( "select * from embeddable_person_map" ).getResultList();
|
||||
} );
|
||||
Session session = openSession();
|
||||
session.getTransaction().begin();
|
||||
session.createSQLQuery( "select * from embeddable_person_map" ).list();
|
||||
session.getTransaction().commit();
|
||||
session.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSelectFromParent() {
|
||||
doInHibernate( this::sessionFactory, session -> {
|
||||
session.createNativeQuery( "select * from person_map" ).getResultList();
|
||||
} );
|
||||
Session session = openSession();
|
||||
session.getTransaction().begin();
|
||||
session.createSQLQuery( "select * from person_map" ).list();
|
||||
session.getTransaction().commit();
|
||||
session.close();
|
||||
}
|
||||
|
||||
@Entity
|
||||
|
|
|
@ -32,11 +32,10 @@ import java.util.Set;
|
|||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate;
|
||||
|
||||
/**
|
||||
* @author Andrea Boriero
|
||||
*/
|
||||
|
@ -50,23 +49,29 @@ public class SingleTableWithEmbeddableTest extends BaseCoreFunctionalTestCase {
|
|||
|
||||
@Test
|
||||
public void testSelectFromEmbeddedField() {
|
||||
doInHibernate( this::sessionFactory, session -> {
|
||||
session.createNativeQuery( "select * from employee_embeddable_person_map" ).getResultList();
|
||||
} );
|
||||
Session session = openSession();
|
||||
session.getTransaction().begin();
|
||||
session.createSQLQuery( "select * from employee_embeddable_person_map" ).list();
|
||||
session.getTransaction().commit();
|
||||
session.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSelectFromSubclass() {
|
||||
doInHibernate( this::sessionFactory, session -> {
|
||||
session.createNativeQuery( "select * from embeddable_person_map" ).getResultList();
|
||||
} );
|
||||
Session session = openSession();
|
||||
session.getTransaction().begin();
|
||||
session.createSQLQuery( "select * from embeddable_person_map" ).list();
|
||||
session.getTransaction().commit();
|
||||
session.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSelectFromParent() {
|
||||
doInHibernate( this::sessionFactory, session -> {
|
||||
session.createNativeQuery( "select * from person_map" ).getResultList();
|
||||
} );
|
||||
Session session = openSession();
|
||||
session.getTransaction().begin();
|
||||
session.createSQLQuery( "select * from person_map" ).list();
|
||||
session.getTransaction().commit();
|
||||
session.close();
|
||||
}
|
||||
|
||||
@Entity
|
||||
|
|
|
@ -32,11 +32,10 @@ import java.util.Set;
|
|||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate;
|
||||
|
||||
/**
|
||||
* @author Andrea Boriero
|
||||
*/
|
||||
|
@ -49,23 +48,29 @@ public class TablePerClassWithEmbeddableTest extends BaseCoreFunctionalTestCase
|
|||
|
||||
@Test
|
||||
public void testSelectFromEmbeddedField() {
|
||||
doInHibernate( this::sessionFactory, session -> {
|
||||
session.createNativeQuery( "select * from employee_embeddable_person_map" ).getResultList();
|
||||
} );
|
||||
Session session = openSession();
|
||||
session.getTransaction().begin();
|
||||
session.createSQLQuery( "select * from employee_embeddable_person_map" ).list();
|
||||
session.getTransaction().commit();
|
||||
session.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSelectFromSubclass() {
|
||||
doInHibernate( this::sessionFactory, session -> {
|
||||
session.createNativeQuery( "select * from embeddable_person_map" ).getResultList();
|
||||
} );
|
||||
Session session = openSession();
|
||||
session.getTransaction().begin();
|
||||
session.createSQLQuery( "select * from embeddable_person_map" ).list();
|
||||
session.getTransaction().commit();
|
||||
session.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSelectFromParent() {
|
||||
doInHibernate( this::sessionFactory, session -> {
|
||||
session.createNativeQuery( "select * from person_map" ).getResultList();
|
||||
} );
|
||||
Session session = openSession();
|
||||
session.getTransaction().begin();
|
||||
session.createSQLQuery( "select * from person_map" ).list();
|
||||
session.getTransaction().commit();
|
||||
session.close();
|
||||
}
|
||||
|
||||
@Entity
|
||||
|
|
Loading…
Reference in New Issue