diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/RootClass.java b/hibernate-core/src/main/java/org/hibernate/mapping/RootClass.java index 46b65b472d..00617ba1ef 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/RootClass.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/RootClass.java @@ -6,7 +6,6 @@ */ package org.hibernate.mapping; -import java.io.Serializable; import java.util.HashSet; import java.util.Iterator; import java.util.Set; @@ -289,11 +288,6 @@ public class RootClass extends PersistentClass implements TableOwner { if ( !ReflectHelper.overridesHashCode( idClass ) ) { LOG.compositeIdClassDoesNotOverrideHashCode( idComponentClassName ); } - if ( !Serializable.class.isAssignableFrom( idClass ) ) { - throw new MappingException( - "Composite-id class must implement Serializable: " + idComponentClassName - ); - } } } } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/attrorder/AttributeOrderingTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/attrorder/AttributeOrderingTests.java index 14ae8d976c..a8615115aa 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/attrorder/AttributeOrderingTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/attrorder/AttributeOrderingTests.java @@ -10,6 +10,7 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.function.Consumer; +import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.mapping.Property; import org.hibernate.metamodel.RuntimeMetamodels; import org.hibernate.metamodel.mapping.AttributeMapping; @@ -39,6 +40,10 @@ import static org.hamcrest.Matchers.notNullValue; public class AttributeOrderingTests { @Test public void testOrdering(DomainModelScope modelScope, SessionFactoryScope sfScope) { + // Force the creation of the session factory + // We need this because properties are only sorted when finishing the initialization of the domain model + SessionFactoryImplementor sessionFactory = sfScope.getSessionFactory(); + // check the boot model.. it should have been sorted as part of calls to // prepare for mapping model creation @@ -47,7 +52,7 @@ public class AttributeOrderingTests { // Also check the mapping model *and* the persister model - these need to be in-sync as far as ordering - final RuntimeMetamodels runtimeMetamodels = sfScope.getSessionFactory().getRuntimeMetamodels(); + final RuntimeMetamodels runtimeMetamodels = sessionFactory.getRuntimeMetamodels(); verifyRuntimeEntityMapping( runtimeMetamodels.getEntityMappingType( TheEntity.class ) ); verifyRuntimeEntityMapping( runtimeMetamodels.getEntityMappingType( "TheEntityHbm" ) ); diff --git a/hibernate-osgi/hibernate-osgi.gradle b/hibernate-osgi/hibernate-osgi.gradle index ffd5b1384d..6b66e0ef54 100644 --- a/hibernate-osgi/hibernate-osgi.gradle +++ b/hibernate-osgi/hibernate-osgi.gradle @@ -90,6 +90,7 @@ dependencies { testCompile( "org.apache.karaf:apache-karaf:${project.karafVersion}" ) { // having trouble finding this one locally exclude group: 'org.eclipse', module: 'org.eclipse.osgi' + exclude group: 'org.hibernate', module: 'hibernate-osgi' } karafDistro "org.apache.karaf:apache-karaf:${project.karafVersion}@tar.gz" diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/EntityManagerFactoryExtension.java b/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/EntityManagerFactoryExtension.java index cb0d81f87b..7e0116797c 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/EntityManagerFactoryExtension.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/EntityManagerFactoryExtension.java @@ -289,8 +289,6 @@ public class EntityManagerFactoryExtension Map integrationSettings) { this.persistenceUnitInfo = persistenceUnitInfo; this.integrationSettings = integrationSettings; - - this.emf = createEntityManagerFactory(); } @Override diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/NotImplementedYetExtension.java b/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/NotImplementedYetExtension.java index 887b7ddba5..212d52dcbe 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/NotImplementedYetExtension.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/NotImplementedYetExtension.java @@ -132,12 +132,16 @@ public class NotImplementedYetExtension final Boolean isStrict = (Boolean) store.get( IS_STRICT_STORE_KEY ); if ( isMarked ) { - if ( throwable instanceof NotImplementedYetException || ! isStrict ) { - store.put( EXCEPTION_STORE_KEY, throwable ); + Throwable t = throwable; + do { + if ( t instanceof NotImplementedYetException || ! isStrict ) { + store.put( EXCEPTION_STORE_KEY, t ); - log.debugf( "#Captured exception %s - ignoring it as expected", throwable ); - return; - } + log.debugf( "#Captured exception %s - ignoring it as expected", t ); + return; + } + t = t.getCause(); + } while ( t != null ); } // Otherwise, rethrow diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/SessionFactoryExtension.java b/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/SessionFactoryExtension.java index d5f1f8ced5..8f1213311c 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/SessionFactoryExtension.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/SessionFactoryExtension.java @@ -236,8 +236,6 @@ public class SessionFactoryExtension SessionFactoryProducer producer) { this.modelScope = modelScope; this.producer = producer; - - this.sessionFactory = createSessionFactory(); } @Override