Re-enabled additional tests and fixed issues with joined subclass inheritance with discriminator
This commit is contained in:
parent
d0f891fca5
commit
2bf36075a4
|
@ -84,7 +84,12 @@ public class StandardPojoEntityRepresentationStrategy implements EntityRepresent
|
|||
this.mappedJtd = jtdRegistry.getDescriptor( mappedJavaType );
|
||||
|
||||
final Class<?> proxyJavaType = bootDescriptor.getProxyInterface();
|
||||
this.proxyJtd = jtdRegistry.getDescriptor( proxyJavaType );
|
||||
if ( proxyJavaType != null ) {
|
||||
this.proxyJtd = jtdRegistry.getDescriptor( proxyJavaType );
|
||||
}
|
||||
else {
|
||||
this.proxyJtd = null;
|
||||
}
|
||||
|
||||
this.lifecycleImplementor = Lifecycle.class.isAssignableFrom( mappedJavaType );
|
||||
this.isBytecodeEnhanced = PersistentAttributeInterceptable.class.isAssignableFrom( mappedJavaType );
|
||||
|
@ -106,7 +111,12 @@ public class StandardPojoEntityRepresentationStrategy implements EntityRepresent
|
|||
// final BytecodeProvider bytecodeProvider = creationContext.getBootstrapContext().getBytecodeProvider();
|
||||
final BytecodeProvider bytecodeProvider = Environment.getBytecodeProvider();
|
||||
|
||||
this.proxyFactory = createProxyFactory( bootDescriptor, bytecodeProvider, creationContext );
|
||||
if ( proxyJtd != null ) {
|
||||
this.proxyFactory = createProxyFactory( bootDescriptor, bytecodeProvider, creationContext );
|
||||
}
|
||||
else {
|
||||
this.proxyFactory = null;
|
||||
}
|
||||
|
||||
this.reflectionOptimizer = resolveReflectionOptimizer( bootDescriptor, bytecodeProvider, sessionFactory );
|
||||
|
||||
|
@ -152,7 +162,13 @@ public class StandardPojoEntityRepresentationStrategy implements EntityRepresent
|
|||
final Set<Class> proxyInterfaces = new java.util.LinkedHashSet<>();
|
||||
|
||||
final Class mappedClass = mappedJtd.getJavaType();
|
||||
final Class proxyInterface = proxyJtd.getJavaType();
|
||||
Class proxyInterface;
|
||||
if ( proxyJtd != null ) {
|
||||
proxyInterface = proxyJtd.getJavaType();
|
||||
}
|
||||
else {
|
||||
proxyInterface = null;
|
||||
}
|
||||
|
||||
if ( proxyInterface != null && ! mappedClass.equals( proxyInterface ) ) {
|
||||
if ( ! proxyInterface.isInterface() ) {
|
||||
|
|
|
@ -139,6 +139,8 @@ public interface EntityMappingType extends ManagedMappingType, Loadable {
|
|||
|
||||
EntityRowIdMapping getRowIdMapping();
|
||||
|
||||
EntityDiscriminatorMapping getDiscriminatorMapping();
|
||||
|
||||
EntityDiscriminatorMapping getDiscriminatorMapping(TableGroup tableGroup);
|
||||
|
||||
NaturalIdMapping getNaturalIdMapping();
|
||||
|
|
|
@ -5808,6 +5808,7 @@ public abstract class AbstractEntityPersister
|
|||
this.versionMapping = superMappingType.getVersionMapping();
|
||||
this.rowIdMapping = superMappingType.getRowIdMapping();
|
||||
this.naturalIdMapping = superMappingType.getNaturalIdMapping();
|
||||
this.discriminatorMapping = superMappingType.getDiscriminatorMapping();
|
||||
}
|
||||
else {
|
||||
identifierMapping = creationProcess.processSubPart(
|
||||
|
@ -6232,6 +6233,11 @@ public abstract class AbstractEntityPersister
|
|||
return rowIdMapping;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityDiscriminatorMapping getDiscriminatorMapping() {
|
||||
return discriminatorMapping;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityDiscriminatorMapping getDiscriminatorMapping(TableGroup tableGroup) {
|
||||
return discriminatorMapping;
|
||||
|
|
|
@ -701,6 +701,11 @@ public class PersisterClassProviderTest {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityDiscriminatorMapping getDiscriminatorMapping() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityDiscriminatorMapping getDiscriminatorMapping(TableGroup tableGroup) {
|
||||
return null;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.test.inheritance.discriminator.joinedsubclass;
|
||||
package org.hibernate.orm.test.inheritance.discriminator.joinedsubclass;
|
||||
|
||||
/**
|
||||
* @author Andrea Boriero
|
|
@ -0,0 +1,135 @@
|
|||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.orm.test.inheritance.discriminator.joinedsubclass;
|
||||
|
||||
import javax.persistence.criteria.CriteriaBuilder;
|
||||
import javax.persistence.criteria.CriteriaQuery;
|
||||
import javax.persistence.criteria.Root;
|
||||
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.orm.junit.DomainModel;
|
||||
import org.hibernate.testing.orm.junit.SessionFactory;
|
||||
import org.hibernate.testing.orm.junit.SessionFactoryScope;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
/**
|
||||
* @author Andrea Boriero
|
||||
*/
|
||||
@TestForIssue(jiraKey = "HHH-9302")
|
||||
@DomainModel(
|
||||
annotatedClasses = {
|
||||
RootEntity.class, SubEntity.class, SubSubEntity.class, SubSubSubEntity.class
|
||||
}
|
||||
)
|
||||
@SessionFactory
|
||||
public class JoinedSubclassTest {
|
||||
|
||||
private Long subSubEntityId;
|
||||
private static final String EXPECTED_SUB_SUB_STRING_VALUE = "SubSub";
|
||||
|
||||
@BeforeEach
|
||||
public void setup(SessionFactoryScope scope) {
|
||||
final SubSubEntity subSubEntity = new SubSubEntity();
|
||||
final SubEntity subEntity = new SubSubEntity();
|
||||
subSubEntity.setSubSubString( EXPECTED_SUB_SUB_STRING_VALUE );
|
||||
scope.inTransaction(
|
||||
session -> {
|
||||
session.save( subEntity );
|
||||
session.save( subSubEntity );
|
||||
}
|
||||
);
|
||||
subSubEntityId = subSubEntity.getId();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldRetrieveSubEntity(SessionFactoryScope scope) {
|
||||
scope.inSession(
|
||||
session -> {
|
||||
RootEntity loaded = session.get( SubEntity.class, subSubEntityId );
|
||||
assertNotNull( loaded );
|
||||
assertTrue( loaded instanceof SubSubEntity );
|
||||
assertEquals( EXPECTED_SUB_SUB_STRING_VALUE, ( (SubSubEntity) loaded ).getSubSubString() );
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldNotRetrieveSubSubSubEntity(SessionFactoryScope scope) {
|
||||
scope.inSession(
|
||||
session -> {
|
||||
SubSubSubEntity loaded = session.get( SubSubSubEntity.class, subSubEntityId );
|
||||
assertNull( loaded );
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// Criteria
|
||||
|
||||
@Test
|
||||
public void shouldRetrieveSubSubEntityWithCriteria(SessionFactoryScope scope) {
|
||||
scope.inSession(
|
||||
session -> {
|
||||
final CriteriaBuilder criteriaBuilder = session.getSessionFactory().getCriteriaBuilder();
|
||||
final CriteriaQuery<SubSubEntity> criteria = criteriaBuilder.createQuery( SubSubEntity.class );
|
||||
final Root<SubSubEntity> root = criteria.from( SubSubEntity.class );
|
||||
criteria.where( criteriaBuilder.equal( root.get( SubSubEntity_.id ), subSubEntityId ) );
|
||||
final SubSubEntity loaded = session.createQuery( criteria ).uniqueResult();
|
||||
assertNotNull( loaded );
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldNotRetrieveSubSubSubEntityWithCriteria(SessionFactoryScope scope) {
|
||||
scope.inSession(
|
||||
session -> {
|
||||
final CriteriaBuilder criteriaBuilder = session.getSessionFactory().getCriteriaBuilder();
|
||||
final CriteriaQuery<SubSubSubEntity> criteria = criteriaBuilder.createQuery( SubSubSubEntity.class );
|
||||
final Root<SubSubSubEntity> root = criteria.from( SubSubSubEntity.class );
|
||||
|
||||
criteria.where( criteriaBuilder.equal( root.get( SubSubSubEntity_.id ), subSubEntityId ) );
|
||||
final SubSubEntity loaded = session.createQuery( criteria ).uniqueResult();
|
||||
assertNull( loaded );
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// HQL
|
||||
|
||||
@Test
|
||||
public void shouldRetrieveSubSubEntityWithHQL(SessionFactoryScope scope) {
|
||||
scope.inSession(
|
||||
session -> {
|
||||
SubSubEntity loaded = (SubSubEntity) session.createQuery(
|
||||
"select se from SubSubEntity se where se.id = :id" )
|
||||
.setParameter( "id", subSubEntityId )
|
||||
.uniqueResult();
|
||||
assertNotNull( loaded );
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldNotRetrieveSubSubSubEntityWithHQL(SessionFactoryScope scope) {
|
||||
scope.inSession(
|
||||
session -> {
|
||||
SubSubSubEntity loaded = (SubSubSubEntity) session.createQuery(
|
||||
"select se from SubSubSubEntity se where se.id = :id" )
|
||||
.setParameter( "id", subSubEntityId )
|
||||
.uniqueResult();
|
||||
assertNull( loaded );
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.orm.test.inheritance.discriminator.joinedsubclass;
|
||||
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.orm.junit.DomainModel;
|
||||
import org.hibernate.testing.orm.junit.SessionFactory;
|
||||
import org.hibernate.testing.orm.junit.SessionFactoryScope;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* @author Andrea Boriero
|
||||
*/
|
||||
@DomainModel(
|
||||
xmlMappings = "org/hibernate/orm/test/inheritance/discriminator/joinedsubclass/TestEntity.hbm.xml"
|
||||
)
|
||||
@SessionFactory
|
||||
public class JoinedSubclassWithRootInterfaceTest {
|
||||
|
||||
@Test
|
||||
@TestForIssue(jiraKey = "HHH-11554")
|
||||
public void testIt(SessionFactoryScope scope) {
|
||||
scope.inTransaction( session -> {
|
||||
final TestEntityImpl testEntity = new TestEntityImpl();
|
||||
testEntity.setId( 1 );
|
||||
session.save( testEntity );
|
||||
} );
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.test.inheritance.discriminator.joinedsubclass;
|
||||
package org.hibernate.orm.test.inheritance.discriminator.joinedsubclass;
|
||||
|
||||
import javax.persistence.DiscriminatorColumn;
|
||||
import javax.persistence.DiscriminatorValue;
|
|
@ -4,7 +4,7 @@
|
|||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.test.inheritance.discriminator.joinedsubclass;
|
||||
package org.hibernate.orm.test.inheritance.discriminator.joinedsubclass;
|
||||
|
||||
import javax.persistence.DiscriminatorValue;
|
||||
import javax.persistence.Entity;
|
|
@ -4,7 +4,7 @@
|
|||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.test.inheritance.discriminator.joinedsubclass;
|
||||
package org.hibernate.orm.test.inheritance.discriminator.joinedsubclass;
|
||||
|
||||
import javax.persistence.DiscriminatorValue;
|
||||
import javax.persistence.Entity;
|
||||
|
@ -15,5 +15,13 @@ import javax.persistence.Entity;
|
|||
@Entity
|
||||
@DiscriminatorValue("SUB-SUB")
|
||||
public class SubSubEntity extends SubEntity {
|
||||
private String SubSubString;
|
||||
|
||||
public String getSubSubString() {
|
||||
return SubSubString;
|
||||
}
|
||||
|
||||
public void setSubSubString(String subSubString) {
|
||||
SubSubString = subSubString;
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.test.inheritance.discriminator.joinedsubclass;
|
||||
package org.hibernate.orm.test.inheritance.discriminator.joinedsubclass;
|
||||
|
||||
import javax.persistence.DiscriminatorValue;
|
||||
import javax.persistence.Entity;
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE hibernate-mapping PUBLIC
|
||||
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
|
||||
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
|
||||
<hibernate-mapping package="org.hibernate.test.inheritance.discriminator.joinedsubclass">
|
||||
<hibernate-mapping package="org.hibernate.orm.test.inheritance.discriminator.joinedsubclass">
|
||||
<class name="TestEntityInterface" table="MY_ENTITY" abstract="true" discriminator-value="null">
|
||||
<cache usage="transactional"/>
|
||||
<id name="id" column="ID" access="property"/>
|
|
@ -4,7 +4,7 @@
|
|||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.test.inheritance.discriminator.joinedsubclass;
|
||||
package org.hibernate.orm.test.inheritance.discriminator.joinedsubclass;
|
||||
|
||||
/**
|
||||
* @author Andrea Boriero
|
|
@ -4,7 +4,7 @@
|
|||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.test.inheritance.discriminator.joinedsubclass;
|
||||
package org.hibernate.orm.test.inheritance.discriminator.joinedsubclass;
|
||||
|
||||
import javax.persistence.Id;
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.test.inheritance.discriminator.joinedsubclass;
|
||||
package org.hibernate.orm.test.inheritance.discriminator.joinedsubclass;
|
||||
|
||||
import javax.persistence.Inheritance;
|
||||
import javax.persistence.InheritanceType;
|
|
@ -638,6 +638,11 @@ public class GoofyPersisterClassProvider implements PersisterClassResolver {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityDiscriminatorMapping getDiscriminatorMapping() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityDiscriminatorMapping getDiscriminatorMapping(TableGroup tableGroup) {
|
||||
return null;
|
||||
|
|
|
@ -1,151 +0,0 @@
|
|||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.test.inheritance.discriminator.joinedsubclass;
|
||||
|
||||
import javax.persistence.criteria.CriteriaBuilder;
|
||||
import javax.persistence.criteria.CriteriaQuery;
|
||||
import javax.persistence.criteria.Root;
|
||||
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.resource.transaction.spi.TransactionStatus;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* @author Andrea Boriero
|
||||
*/
|
||||
@TestForIssue(jiraKey = "HHH-9302")
|
||||
public class JoinedSubclassTest extends BaseCoreFunctionalTestCase {
|
||||
|
||||
private Long subSubEntityId;
|
||||
|
||||
@Override
|
||||
protected Class<?>[] getAnnotatedClasses() {
|
||||
return new Class[] {RootEntity.class, SubEntity.class, SubSubEntity.class, SubSubSubEntity.class};
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
session = openSession();
|
||||
Transaction transaction = session.beginTransaction();
|
||||
|
||||
final SubSubEntity subSubEntity = new SubSubEntity();
|
||||
final SubEntity subEntity = new SubSubEntity();
|
||||
try {
|
||||
session.save( subEntity );
|
||||
session.save( subSubEntity );
|
||||
transaction.commit();
|
||||
subSubEntityId = subSubEntity.getId();
|
||||
}
|
||||
finally {
|
||||
if ( transaction.getStatus() == TransactionStatus.ACTIVE ) {
|
||||
transaction.rollback();
|
||||
}
|
||||
}
|
||||
session.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldRetrieveSubEntity() {
|
||||
session = openSession();
|
||||
try {
|
||||
RootEntity loaded = session.get( SubEntity.class, subSubEntityId );
|
||||
assertNotNull( loaded );
|
||||
assertTrue( loaded instanceof SubSubEntity );
|
||||
}
|
||||
finally {
|
||||
session.close();
|
||||
}
|
||||
}
|
||||
|
||||
public void shouldNotRetrieveSubSubSubEntity() {
|
||||
session = openSession();
|
||||
try {
|
||||
SubSubSubEntity loaded = session.get( SubSubSubEntity.class, subSubEntityId );
|
||||
assertNull( loaded );
|
||||
}
|
||||
finally {
|
||||
session.close();
|
||||
}
|
||||
}
|
||||
|
||||
// Criteria
|
||||
|
||||
@Test
|
||||
public void shouldRetrieveSubSubEntityWithCriteria() {
|
||||
session = openSession();
|
||||
try {
|
||||
final CriteriaBuilder criteriaBuilder = session.getSessionFactory().getCriteriaBuilder();
|
||||
final CriteriaQuery<SubSubEntity> criteria = criteriaBuilder.createQuery( SubSubEntity.class );
|
||||
final Root<SubSubEntity> root = criteria.from( SubSubEntity.class );
|
||||
criteria.where( criteriaBuilder.equal( root.get( SubSubEntity_.id ), subSubEntityId ) );
|
||||
final SubSubEntity loaded = session.createQuery( criteria ).uniqueResult();
|
||||
assertNotNull( loaded );
|
||||
}
|
||||
finally {
|
||||
session.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldNotRetrieveSubSubSubEntityWithCriteria() {
|
||||
session = openSession();
|
||||
try {
|
||||
final CriteriaBuilder criteriaBuilder = session.getSessionFactory().getCriteriaBuilder();
|
||||
final CriteriaQuery<SubSubSubEntity> criteria = criteriaBuilder.createQuery( SubSubSubEntity.class );
|
||||
final Root<SubSubSubEntity> root = criteria.from( SubSubSubEntity.class );
|
||||
|
||||
criteria.where( criteriaBuilder.equal( root.get( SubSubSubEntity_.id ), subSubEntityId ) );
|
||||
final SubSubEntity loaded = session.createQuery( criteria ).uniqueResult();
|
||||
assertNull( loaded );
|
||||
}
|
||||
finally {
|
||||
session.close();
|
||||
}
|
||||
}
|
||||
|
||||
// HQL
|
||||
|
||||
@Test
|
||||
public void shouldRetrieveSubSubEntityWithHQL() {
|
||||
session = openSession();
|
||||
try {
|
||||
SubSubEntity loaded = (SubSubEntity) session.createQuery(
|
||||
"select se from SubSubEntity se where se.id = :id" )
|
||||
.setParameter( "id", subSubEntityId )
|
||||
.uniqueResult();
|
||||
assertNotNull( loaded );
|
||||
}
|
||||
finally {
|
||||
session.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldNotRetrieveSubSubSubEntityWithHQL() {
|
||||
session = openSession();
|
||||
try {
|
||||
SubSubSubEntity loaded = (SubSubSubEntity) session.createQuery(
|
||||
"select se from SubSubSubEntity se where se.id = :id" )
|
||||
.setParameter( "id", subSubEntityId )
|
||||
.uniqueResult();
|
||||
assertNull( loaded );
|
||||
}
|
||||
finally {
|
||||
session.close();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.test.inheritance.discriminator.joinedsubclass;
|
||||
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author Andrea Boriero
|
||||
*/
|
||||
public class JoinedSubclassWithRootInterfaceTest extends BaseCoreFunctionalTestCase {
|
||||
|
||||
@Override
|
||||
protected String[] getMappings() {
|
||||
return new String[] {"TestEntity.hbm.xml"};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBaseForMappings() {
|
||||
return "org/hibernate/test/inheritance/discriminator/joinedsubclass/";
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestForIssue( jiraKey = "HHH-11554")
|
||||
public void testIt() {
|
||||
TransactionUtil.doInHibernate( this::sessionFactory, session -> {
|
||||
final TestEntityImpl testEntity = new TestEntityImpl();
|
||||
testEntity.setId( 1 );
|
||||
session.save( testEntity );
|
||||
} );
|
||||
}
|
||||
}
|
|
@ -750,6 +750,11 @@ public class CustomPersister implements EntityPersister {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityDiscriminatorMapping getDiscriminatorMapping() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityDiscriminatorMapping getDiscriminatorMapping(TableGroup tableGroup) {
|
||||
return null;
|
||||
|
|
Loading…
Reference in New Issue