HHH-11383 : Fix tests to work on pre-5.2
This commit is contained in:
parent
b19e831c93
commit
2523f0abbb
|
@ -9,6 +9,7 @@ package org.hibernate.envers.test.integration.query;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.EntityManager;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
import javax.persistence.Inheritance;
|
import javax.persistence.Inheritance;
|
||||||
import javax.persistence.InheritanceType;
|
import javax.persistence.InheritanceType;
|
||||||
|
@ -22,7 +23,6 @@ import org.hibernate.envers.test.Priority;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import org.hibernate.testing.TestForIssue;
|
import org.hibernate.testing.TestForIssue;
|
||||||
import org.hibernate.testing.transaction.TransactionUtil;
|
|
||||||
|
|
||||||
import static org.hibernate.envers.query.AuditEntity.disjunction;
|
import static org.hibernate.envers.query.AuditEntity.disjunction;
|
||||||
import static org.hibernate.envers.query.AuditEntity.property;
|
import static org.hibernate.envers.query.AuditEntity.property;
|
||||||
|
@ -41,7 +41,9 @@ public class InheritanceAssociationToOneInnerJoinTest extends BaseEnversJPAFunct
|
||||||
@Test
|
@Test
|
||||||
@Priority(10)
|
@Priority(10)
|
||||||
public void initData() {
|
public void initData() {
|
||||||
TransactionUtil.doInJPA( this::entityManagerFactory, entityManager -> {
|
EntityManager entityManager = getOrCreateEntityManager();
|
||||||
|
entityManager.getTransaction().begin();
|
||||||
|
{
|
||||||
final EntityC c = new EntityC();
|
final EntityC c = new EntityC();
|
||||||
c.setId( 1 );
|
c.setId( 1 );
|
||||||
c.setFoo( "bar" );
|
c.setFoo( "bar" );
|
||||||
|
@ -65,7 +67,9 @@ public class InheritanceAssociationToOneInnerJoinTest extends BaseEnversJPAFunct
|
||||||
b2.setRelationToC( c );
|
b2.setRelationToC( c );
|
||||||
b2.setRelationToD( d );
|
b2.setRelationToD( d );
|
||||||
entityManager.persist( b2 );
|
entityManager.persist( b2 );
|
||||||
} );
|
}
|
||||||
|
entityManager.getTransaction().commit();
|
||||||
|
entityManager.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue