-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Metamodel Integration Tasks
This document is specifically about integrating the new metamodel into master branch of hibernate-orm repository.
Tests that are known to fail on current metamodel branch are listed here.
Integration JIRA issue: HHH-8897
Repository: https://github.com/hibernate/hibernate-orm (branch: master)
Commit before integration: 1a87adca088c7b55f05726d25c9d6847dd5bb4e4
In order to minimize the impact of diverging functionality in master/metamodel branches, I took the following approach:
- create a branch of master (HHH-8897-replace-metamodel);
- delete the existing org.hibernate.metamodel package (main and test);
- org.hibernate.metamodel package (main and test) from the metamodel branch into into HHH-8897-replace-metamodel;
- make minimal code changes to accommodate the new metamodel.
This allows new/diverging functionality from the metamodel branch (outside of org.hibernate.metamodel) to be merged by the person most knowledgeable about that new/diverging functionality.
I did merge some functionality from metamodel branch that was required by org.hibernate.metamodel for compiling. In these cases, I made a guess and in some cases only merged some of the code for particular JIRA issues. It would be good for someone more familiar with the code to ensure that I did the right thing and in those cases where only parts were merged, to finish merging.
-
HHH-6054: Support for discriminator-based multi-tenancy (Steve)
-
HHH-7472 : Introduce a "schema management" service (Steve/Brett)
-
HHH-7803 : Introduce settings to ease some JPA 2.1 restrictions (Brett)
-
HHH-8224 : Add implicit constraint names to NamingStrategy (Brett)
-
HHH-7709 : change org.hibernate.type.ForeignKeyDirection to enum (Strong/Gail)
-
HHH-7904 : uniform how to use NamingStrategy (Strong/Gail)
-
HHH-7736 : join subclass support (Strong/Gail)
-
HHH-6446 : Integrate new metamodel into SchemaValidator (Brett)
-
HHH-7797 : Inconsistent logic by uses of Dialect#supportsNotNullUnique (Brett)
-
HHH-7002 : SchemaExport ERROR when using in-memory database (H2) - drop constraint issue HHH000389 (Brett)
-
[HHH-7556 : Clean up packages] (https://hibernate.atlassian.net/browse/HHH-7556) (Steve)
-
HHH-8118 : Create one OSGiClassLoader per persistence unit (Brett)
-
HHH-7491 : fix test failures caused by natural id cache access strategy is not exposed to the persister (Strong/Gail)
-
merged org.hibernate.id (why does IncrementGenerator still use o.h.mapping.Table???)
-
ReflectHelper.classForName() is still used in DefaultIdentifierGeneratorFactory.getIdentifierGeneratorClass() and add it to UUIDGenerator.configure(). Is that OK?
Still need to merge the following from metamodel (not a complete list):
- session and entity manager factory building
- make CacheRegion a service
- new tests added metamodel (not in master)
Misc. TODOs:
- @Embeddable classes need to be added to tests using BaseCoreFunctionalTestCase.getAnnotatedClasses(). Is that expected???
- check duplication between org/hibernate/engine/jdbc/connections/spi/JdbcConnectionAccess and org/hibernate/engine/jdbc/spi/JdbcConnectionAccess
- check duplication between hibernate-core/src/main/java/org/hibernate/jpa/metamodel/internal/ and hibernate-entitymanager/src/main/java/org/hibernate/jpa/internal/metamodel
- MultiTableBulkIdStrategy is not supported because Mappings is not implemented for new metamodel
- Add support for new property generation.
- Add SingularAttributebinding.isLob (needed by AbstractEntityPersister)
- Add DerivedValue.getText( Dialect )
- Remove Configuration and MetadataImplementor from collection persister args
- Remove AbstractCollectionPersister.nodeName, elementNodeName, indexNodeName
- Remove obsolete dialects (old postgresql and oracle dialects)
- Remove obsolete TypeFactory methods and Type constructors
- Get rid of CollectionType.getElementClass(); should be able to get it from domain. Problem is that ClassLoaderService cannot handle primitive classes. Should it? I've temporarily added a map of primitive class names -> Class to MetadataImpl to deal with primitive arrays.
The following test failures probably require functionality to be merged from metamodel branch:
BeanValidation is not working (Hardy?):
- org.hibernate.test.annotations.beanvalidation.BeanValidationAutoTest
- org.hibernate.test.annotations.beanvalidation.BeanValidationGroupsTest
- org.hibernate.test.annotations.beanvalidation.BeanValidationProvidedFactoryTest
- org.hibernate.test.annotations.beanvalidation.DDLTest
- org.hibernate.test.annotations.beanvalidation.DDLWithoutCallbackTest
- org.hibernate.test.annotations.beanvalidation.HibernateTraversableResolverTest
- org.hibernate.test.c3p0.StatementCacheTest
key-many-to-one on-delete="..." not supported (need to rebuild xsd) (introduced by HHH-7807) (Steve or Brett?):
- org.hibernate.test.hql.BulkManipulationTest
- org.hibernate.test.idprops.IdentifierPropertyReferencesTest
- org.hibernate.test.immutable.ImmutableTest
- org.hibernate.test.keymanytoone.bidir.component.EagerKeyManyToOneTest
- org.hibernate.test.keymanytoone.bidir.component.LazyKeyManyToOneTest
- org.hibernate.test.keymanytoone.bidir.embedded.KeyManyToOneTest
- org.hibernate.test.keymanytoone.bidir.ondelete.KeyManyToOneCascadeDeleteTest
- org.hibernate.test.keymanytoone.unidir.ondelete.KeyManyToOneCascadeDeleteTest
- org.hibernate.test.loadplans.process.NonEncapsulatedCompositeIdResultSetProcessorTest
- org.hibernate.test.loadplans.walking.KeyManyToOneWalkingTest
- org.hibernate.test.onetoone.formula.OneToOneFormulaTest
Discriminators for joined subclasses has wrong type sometimes (related to addition of AvailableSettings.IMPLICIT_DISCRIMINATOR_COLUMNS_FOR_JOINED_SUBCLASS???) (Strong or Gail):
- org.hibernate.test.joinedsubclass.JoinedSubclassWithImplicitDiscriminatorTest.metadataAssertions()
- org.hibernate.test.joinedsubclass.JoinedSubclassWithExplicitDiscriminatorTest.metadataAssertions()
- org.hibernate.test.collection.lazynocascade.LazyAssociationNoCascadeTest
EntityMode.MAP not working:
- org.hibernate.test.entitymode.map.basic.DynamicClassTest
- org.hibernate.test.entitymode.map.subclass.SubclassDynamicMapTest
- org.hibernate.test.legacy.MapTest
- org.hibernate.test.onetoone.nopojo.DynamicMapOneToOneTest
- org.hibernate.test.tm.CMTTest
org.hibernate.test.cid.CompositeIdWithGeneratorTest fails in master because new metamodel cannot handle an IdentityGenerator w/ more than one column. (was changed to IdentifierGenerator on metamodel branch). org.hibernate.test.propertyref.basic.BasicPropertiesTest fails on master; not in metamodel branch.
New metamodel does not support a registered default tuplizer (IIRC, that should be added as a service):
- org.hibernate.test.dynamicentity.tuplizer2.ImprovedTuplizerDynamicEntityTest
Default index type when @MapKeyColumn is used:
- org.hibernate.test.collection.map.PersistentMapTest
Tests that extend BaseUnitTestCase (and not BaseCoreFunctionalTestCase) that explicitly build Configuration (requires merging changes to testing code from metamodel branch). For now, they throw NotYetImplementedException:
- org.hibernate.test.annotations.access.xml.XmlAccessTest
- org.hibernate.test.annotations.id.JoinColumnOverrideTest
- org.hibernate.test.annotations.id.sequences.JoinColumnOverrideTest
- org.hibernate.test.annotations.uniqueconstraint.UniqueConstraintValidationTest
- org.hibernate.test.cfg.cache.CacheConfigurationTest
- org.hibernate.test.nationalized.SimpleNationalizedTest
- org.hibernate.test.naturalid.inheritance.spread.SpreadNaturalIdTest
- org.hibernate.test.type.AttributeConverterTest
- org.hibernate.serialization.SessionFactorySerializationTest
Tests that don't support new metamodel yet (only use configuration()):
- org.hibernate.test.constraint.ConstraintTest
- other tests in envers and infinispan
Don't know why the following are passing with new metamodel (they are marked @FailureExpected in both metamodel and master branches):
- org.hibernate.test.collection.set.PersistentSetNonLazyTest.testLoadChildCheckParentContainsChildCache
Don't know why the following are passing after integration into master (they are marked @FailureExpectedWithNewMetamodel in metamodel branch):
- org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testLazy()
- org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testLazyManyToOne
- org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testManyToOneProxy
- org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testSharedPKOneToOne
Still need to figure out why the following are failing:
org.hibernate.test.ops.SaveOrUpdateTest > testSaveOrUpdateGotWithMutableProp FAILED java.lang.AssertionError at SaveOrUpdateTest.java:537
org.hibernate.test.typedonetoone.TypedOneToOneTest > classMethod FAILED org.hibernate.testing.junit4.CallbackException Caused by: org.hibernate.HibernateException
org.hibernate.test.loadplans.process.EncapsulatedCompositeIdResultSetProcessorTest > classMethod FAILED org.hibernate.testing.junit4.CallbackException Caused by: org.hibernate.AnnotationException
org.hibernate.test.namingstrategy.NamingStrategyTest > testDatabaseColumnNames FAILED org.junit.ComparisonFailure at NamingStrategyTest.java:83
org.hibernate.test.namingstrategy.NamingStrategyTest > testDatabaseTableNames FAILED org.junit.ComparisonFailure at NamingStrategyTest.java:107
org.hibernate.test.service.ServiceBootstrappingTest > testBasicBuild FAILED java.lang.AssertionError at ServiceBootstrappingTest.java:58
org.hibernate.test.sql.storedproc.StoredProcedureTest > testGetResultListTuple FAILED org.hibernate.exception.GenericJDBCException at StoredProcedureTest.java:209 Caused by: org.h2.jdbc.JdbcSQLException at StoredProcedureTest.java:209
org.hibernate.test.sql.storedproc.StoredProcedureTest > testGetSingleResultTuple FAILED org.hibernate.exception.GenericJDBCException at StoredProcedureTest.java:190 Caused by: org.h2.jdbc.JdbcSQLException at StoredProcedureTest.java:190
org.hibernate.test.sql.storedproc.StoredProcedureTest > testInParametersByName FAILED org.hibernate.exception.GenericJDBCException at StoredProcedureTest.java:247 Caused by: org.h2.jdbc.JdbcSQLException at StoredProcedureTest.java:247
org.hibernate.test.sql.storedproc.StoredProcedureTest > testInParametersByPosition FAILED org.hibernate.exception.GenericJDBCException at StoredProcedureTest.java:272 Caused by: org.h2.jdbc.JdbcSQLException at StoredProcedureTest.java:272
org.hibernate.test.onetoone.singletable.DiscrimSubclassOneToOneTest > classMethod FAILED org.hibernate.testing.junit4.CallbackException Caused by: org.hibernate.HibernateException
org.hibernate.test.onetoone.joined.JoinedSubclassOneToOneTest > classMethod FAILED org.hibernate.testing.junit4.CallbackException Caused by: org.hibernate.HibernateException
org.hibernate.test.generated.DefaultGeneratedValueTest > testGeneration FAILED org.hibernate.exception.ConstraintViolationException at DefaultGeneratedValueTest.java:84 Caused by: org.h2.jdbc.JdbcSQLException at DefaultGeneratedValueTest.java:84
org.hibernate.test.generated.DefaultGeneratedValueTest > testUpdateTimestampGeneration FAILED org.hibernate.exception.ConstraintViolationException at DefaultGeneratedValueTest.java:119 Caused by: org.h2.jdbc.JdbcSQLException at DefaultGeneratedValueTest.java:119
org.hibernate.test.jpa.proxy.JPAProxyTest > testEjb3ProxyUsage FAILED java.lang.AssertionError at JPAProxyTest.java:63
org.hibernate.test.jpa.proxy.JPAProxyTest > testGetSemantics FAILED java.lang.AssertionError at JPAProxyTest.java:116
org.hibernate.test.annotations.JoinedSubclassTest > classMethod FAILED org.hibernate.testing.junit4.CallbackException Caused by: org.hibernate.metamodel.spi.source.MappingException
org.hibernate.test.annotations.embedded.many2one.EmbeddableWithMany2OneTest > classMethod FAILED org.hibernate.testing.junit4.CallbackException Caused by: org.hibernate.MappingException Caused by: java.lang.NullPointerException
org.hibernate.test.annotations.entity.BasicHibernateAnnotationsTest > testPolymorphism FAILED java.lang.AssertionError at BasicHibernateAnnotationsTest.java:164
org.hibernate.test.annotations.entity.BasicHibernateAnnotationsTest > testSerialized FAILED org.hibernate.exception.ConstraintViolationException Caused by: org.h2.jdbc.JdbcSQLException
org.hibernate.test.annotations.entity.NewCustomEntityMappingAnnotationsTest > testSameMappingValues FAILED java.lang.AssertionError at NewCustomEntityMappingAnnotationsTest.java:54
org.hibernate.test.annotations.join.JoinTest > classMethod FAILED org.hibernate.testing.junit4.CallbackException Caused by: org.hibernate.metamodel.spi.source.MappingException
org.hibernate.test.annotations.target.TargetTest > classMethod FAILED org.hibernate.testing.junit4.CallbackException Caused by: org.hibernate.cfg.NotYetImplementedException
org.hibernate.test.annotations.persister.PersisterTest > classMethod FAILED org.hibernate.testing.junit4.CallbackException Caused by: org.hibernate.MappingException Caused by: java.lang.NoSuchMethodException
org.hibernate.test.annotations.manytoonewithformula.ManyToOneWithFormulaTest > classMethod FAILED org.hibernate.testing.junit4.CallbackException Caused by: org.hibernate.tool.schema.spi.SchemaManagementException
org.hibernate.test.annotations.onetoone.OneToOneTest > classMethod FAILED org.hibernate.testing.junit4.CallbackException Caused by: org.hibernate.cfg.NotYetImplementedException
org.hibernate.test.annotations.polymorphism.PolymorphismTest > testPolymorphism FAILED java.lang.AssertionError at PolymorphismTest.java:53
org.hibernate.test.annotations.cascade.CascadeToEmbeddedManyToOneTest > classMethod FAILED org.hibernate.testing.junit4.CallbackException Caused by: org.hibernate.metamodel.spi.source.MappingException
org.hibernate.test.annotations.derivedidentities.bidirectional.OneToOneWithDerivedIdentityTest > testCase FAILED java.lang.NullPointerException at OneToOneWithDerivedIdentityTest.java:107
org.hibernate.test.annotations.derivedidentities.bidirectional.OneToOneWithDerivedIdentityTest > testInsertFooAndBarWithDerivedId FAILED java.lang.StackOverflowError
org.hibernate.test.annotations.derivedidentities.bidirectional.OneToOneWithDerivedIdentityTest > testSelectWithDerivedId FAILED java.lang.NullPointerException at OneToOneWithDerivedIdentityTest.java:79
org.hibernate.test.annotations.id.sequences.HibernateSequenceTest > testHibernateSequenceSchema FAILED org.junit.ComparisonFailure at HibernateSequenceTest.java:52
org.hibernate.test.annotations.lob.SerializableToBlobTypeTest > testTypeDefinition FAILED org.junit.ComparisonFailure at SerializableToBlobTypeTest.java:38
org.hibernate.test.annotations.collectionelement.embeddables.withcustomenumdef.TestBasicOps > classMethod FAILED org.hibernate.testing.junit4.CallbackException Caused by: java.lang.IllegalArgumentException
org.hibernate.test.annotations.collectionelement.ordered.ElementCollectionSortingTest > classMethod FAILED org.hibernate.testing.junit4.CallbackException Caused by: java.lang.IllegalArgumentException
org.hibernate.test.annotations.manytomany.ManyToManyMaxFetchDepth0Test > classMethod FAILED org.hibernate.testing.junit4.CallbackException Caused by: org.hibernate.cfg.NotYetImplementedException
org.hibernate.test.annotations.manytomany.ManyToManyTest > classMethod FAILED org.hibernate.testing.junit4.CallbackException Caused by: org.hibernate.cfg.NotYetImplementedException
org.hibernate.test.locale.LocaleTest > testMetadataWithLocale FAILED org.hibernate.testing.junit4.CallbackException Caused by: org.hibernate.MappingException Caused by: java.lang.ClassNotFoundException
org.hibernate.test.any.AnyTypeTest > testJoinFetchOfAnAnyTypeAttribute FAILED java.lang.Exception Caused by: org.hibernate.QueryException at AnyTypeTest.java:81 Caused by: org.hibernate.QueryException at AnyTypeTest.java:81
org.hibernate.test.events.CallbackTest > testCallbacks FAILED java.lang.AssertionError at CallbackTest.java:104
org.hibernate.test.filter.DynamicFilterTest > testSecondLevelCachedCollectionsFiltering FAILED java.lang.AssertionError at DynamicFilterTest.java:118
org.hibernate.test.constraint.ConstraintTest > classMethod FAILED org.hibernate.testing.junit4.CallbackException Caused by: java.lang.IllegalArgumentException
org.hibernate.test.cascade.circle.CascadeMergeToChildBeforeParentTest > testMergeData3Nodes FAILED org.hibernate.PropertyValueException at CascadeMergeToChildBeforeParentTest.java:279
org.hibernate.test.cascade.circle.CascadeMergeToChildBeforeParentTest > testMergeTransientChildBeforeTransientParent FAILED org.hibernate.PropertyValueException at CascadeMergeToChildBeforeParentTest.java:192
org.hibernate.test.legacy.IJ2Test > testUnionSubclass FAILED org.hibernate.exception.SQLGrammarException at IJ2Test.java:55 Caused by: org.h2.jdbc.JdbcSQLException at IJ2Test.java:55
org.hibernate.test.legacy.SQLFunctionsTest > testBlobClob FAILED org.hibernate.exception.SQLGrammarException at SQLFunctionsTest.java:561 Caused by: org.h2.jdbc.JdbcSQLException at SQLFunctionsTest.java:561
org.hibernate.test.querycache.QueryCacheTest > testQueryCacheInvalidation FAILED java.lang.AssertionError at QueryCacheTest.java:219
org.hibernate.test.collection.set.PersistentSetNonLazyTest > testLoadChildCheckParentContainsChildCache FAILED org.hibernate.testing.junit4.FailureExpectedHandler$FailureExpectedTestPassedException
org.hibernate.test.subselect.SubselectTest > testCustomColumnReadAndWrite FAILED org.hibernate.exception.SQLGrammarException at SubselectTest.java:106 Caused by: org.h2.jdbc.JdbcSQLException at SubselectTest.java:106
org.hibernate.test.subselect.SubselectTest > testEntitySubselect FAILED org.hibernate.exception.SQLGrammarException at SubselectTest.java:60 Caused by: org.h2.jdbc.JdbcSQLException at SubselectTest.java:60
org.hibernate.test.subclassfilter.UnionSubclassFilterTest > testFiltersWithUnionSubclass FAILED org.hibernate.exception.SQLGrammarException at UnionSubclassFilterTest.java:141 Caused by: org.h2.jdbc.JdbcSQLException at UnionSubclassFilterTest.java:141
org.hibernate.test.propertyref.inheritence.union.UnionSubclassPropertyRefTest > testOneToOnePropertyRef FAILED org.hibernate.exception.SQLGrammarException at UnionSubclassPropertyRefTest.java:58 Caused by: org.h2.jdbc.JdbcSQLException at UnionSubclassPropertyRefTest.java:58
org.hibernate.test.propertyref.inheritence.discrim.SubclassPropertyRefTest > testOneToOnePropertyRef FAILED org.hibernate.exception.SQLGrammarException at SubclassPropertyRefTest.java:58 Caused by: org.h2.jdbc.JdbcSQLException at SubclassPropertyRefTest.java:58
org.hibernate.test.propertyref.basic.PropertyRefTest > testJoinFetchPropertyRef FAILED org.hibernate.exception.SQLGrammarException at PropertyRefTest.java:243 Caused by: org.h2.jdbc.JdbcSQLException at PropertyRefTest.java:243
org.hibernate.test.propertyref.basic.PropertyRefTest > testNonLazyBagKeyPropertyRef FAILED org.hibernate.exception.SQLGrammarException at PropertyRefTest.java:82 Caused by: org.h2.jdbc.JdbcSQLException at PropertyRefTest.java:82
org.hibernate.test.propertyref.basic.PropertyRefTest > testOneToOnePropertyRef FAILED org.hibernate.exception.SQLGrammarException at PropertyRefTest.java:160 Caused by: org.h2.jdbc.JdbcSQLException at PropertyRefTest.java:160
org.hibernate.test.propertyref.basic.BasicPropertiesTest > testProperties FAILED java.lang.AssertionError at BasicPropertiesTest.java:67
org.hibernate.test.propertyref.component.partial.PartialComponentPropertyRefTest > testComponentPropertyRef FAILED java.lang.AssertionError at PartialComponentPropertyRefTest.java:76
org.hibernate.test.propertyref.component.complete.CompleteComponentPropertyRefTest > testComponentPropertyRef FAILED java.lang.AssertionError at CompleteComponentPropertyRefTest.java:77
org.hibernate.test.typedmanytoone.TypedManyToOneTest > classMethod FAILED org.hibernate.testing.junit4.CallbackException Caused by: org.hibernate.HibernateException
org.hibernate.test.entityname.EntityNameFromSubClassTest > classMethod FAILED org.hibernate.testing.junit4.CallbackException Caused by: org.hibernate.HibernateException