Skip to content

Failing metamodel tests

Strong Liu edited this page May 29, 2013 · 144 revisions

XML PROCESSING

  • org/hibernate/test/legacy/CustomSQLTest.java (HHH-7925)

NPE DUE TO UNINITIALIZED STUFF IN COLLECTIONS

Index column value is not initialized, resulting in NPE:
  • org/hibernate/test/annotations/enumerated/mapkey/MapKeyEnumeratedTest.java
  • org/hibernate/test/joinfetch/JoinFetchTest.java
  • org/hibernate/test/extralazy/ExtraLazyTest.java

list does not have index type bound; causes NPE

HBM "index-many-to-many" NOT SUPPORTED

  • org/hibernate/test/hql/ClassicTranslatorTest
  • org/hibernate/test/hql/CriteriaClassicAggregationReturnTest
  • org/hibernate/test/hql/HQLTest
  • org/hibernate/test/legacy/FooBarTest
  • org/hibernate/test/legacy/FumTest
  • org/hibernate/test/legacy/ParentChildTest

HBM "map-key-many-to-many" NOT SUPPORTED

  • org/hibernate/test/ternary/TernaryTest

referenced join columns do not correspond with columns bound for an attribute binding

  • org.hibernate.test.annotations.cid.CompositeIdTest
  • org.hibernate.test.annotations.manytoone.referencedcolumnname.ManyToOneReferencedColumnNameTest
  • org.hibernate.test.annotations.onetomany.OrderByTest

"idbag" is not supported yet:

  • org/hibernate/test/idbag/IdBagTest.java
  • org/hibernate/test/collection/idbag/PersistentIdBagTest.java
  • org.hibernate.test.annotations.collectionelement.indexedCollection.IndexedCollectionOfElementsTest
  • org/hibernate/test/annotations/identifiercollection/IdentifierCollectionTest.java

ELEMENT COLLECTIONS

Element collection is not supported using annotations (Wrong attribute nature for toOne attribute: ELEMENT_COLLECTION_BASIC):

  • org/hibernate/test/annotations/collectionelement/CollectionElementTest
  • org/hibernate/test/annotations/override/AssociationOverrideTest

Default columns for HBM basic collections are not correct

Maps using annotations is not working

  • org/hibernate/test/collection/map/hhh7557/EntityMapTest.java

Misc bugs with embeddables (HHH-7919):

  • org.hibernate.test.legacy.ComponentNotNullTest (HBM "nested-composite-element" is not supported)
  • org/hibernate/test/hql/EJBQLTest
  • org.hibernate.test.annotations.embedded.EmbeddedTest.testDefaultCollectionTable
  • org.hibernate.test.annotations.embedded.EmbeddedTest.testDottedProperty
  • org.hibernate.test.annotations.embedded.EmbeddedTest.testEmbeddedSuperclass

@AttributeOverride / @AssociationOverride is not used

  • org.hibernate.test.annotations.override.AssociationOverrideSchemaTest

Derived (formula) values

Derived values are not supported when creating a foreign key that targets columns:

  • org/hibernate/test/unconstrained/UnconstrainedTest

Derived value as collection index is not supported yet:

  • org/hibernate/test/map/MapIndexFormulaTest

IDs

"hilo"/TableGenerator ID generator not working (TableGenerator is deprecated; should the ID generator be changed for these tests? if so, to which generator?):

  • org/hibernate/test/propertyref/basic/PropertyRefTest.java
  • org/hibernate/test/subselect/SubselectTest.java
  • org/hibernate/test/idgen/enhanced/table/BasicTableTest.java
  • org/hibernate/test/idgen/enhanced/table/HiLoTableTest.java

virtual id attribute

  • org.hibernate.test.legacy.MasterDetailTest

    see HHH-7858

key-many-to-one bugs

  • org/hibernate/test/annotations/idclassgeneratedvalue/IdClassGeneratedValueTest.java

  • org/hibernate/test/annotations/idmanytoone/alphabetical/AlphabeticalIdManyToOneTest.java

  • org/hibernate/test/annotations/id/sequences/HibernateSequenceTest.java

Derived IDs are not supported:

  • org.hibernate.test.annotations.derivedidentities.e1.a.DerivedIdentitySimpleParentIdClassDepTest
  • org/hibernate/test/annotations/derivedidentities/e1/b2/IdClassGeneratedValueManyToOneTest.java
  • org/hibernate/test/annotations/derivedidentities/e1/b/DerivedIdentitySimpleParentEmbeddedIdDepTest.java
  • org/hibernate/test/annotations/derivedidentities/e1/b/specjmapid/IdMapManyToOneSpecjTest.java
  • org/hibernate/test/annotations/derivedidentities/e1/b/specjmapid/lazy/CompositeKeyDeleteTest.java
  • org/hibernate/test/annotations/derivedidentities/e1/c/DerivedIdentitySimpleParentEmbeddedDepTest.java
  • org/hibernate/test/annotations/derivedidentities/e2/a/DerivedIdentityIdClassParentIdClassDepTest.java
  • org/hibernate/test/annotations/derivedidentities/e2/b/DerivedIdentityIdClassParentEmbeddedIdDepTest.java
  • org/hibernate/test/annotations/derivedidentities/e3/a/DerivedIdentityEmbeddedIdParentIdClassTest.java
  • org/hibernate/test/annotations/derivedidentities/e3/b/DerivedIdentityEmbeddedIdParentEmbeddedIdDepTest.java
  • org/hibernate/test/annotations/derivedidentities/e4/a/DerivedIdentitySimpleParentSimpleDepTest.java
  • org/hibernate/test/annotations/derivedidentities/e4/b/DerivedIdentitySimpleParentSimpleDepMapsIdTest.java
  • org/hibernate/test/annotations/derivedidentities/e5/a/DerivedIdentityIdClassParentSameIdTypeIdClassDepTest.java
  • org/hibernate/test/annotations/derivedidentities/e5/b/DerivedIdentityIdClassParentSameIdTypeEmbeddedIdDepTest.java
  • org/hibernate/test/annotations/derivedidentities/e5/c/ForeignGeneratorViaMapsIdTest.java
  • org/hibernate/test/annotations/derivedidentities/e6/a/DerivedIdentityEmbeddedIdParentSameIdTypeIdClassDepTest.java
  • org/hibernate/test/annotations/derivedidentities/e6/b/DerivedIdentityEmbeddedIdParentSameIdTypeEmbeddedIdDepTest.java
  • org/hibernate/test/annotations/query/QueryAndSQLTest.java
  • org/hibernate/test/cid/CompositeIdWithGeneratorTest.java

HBM "properties" is not supported yet

  • org/hibernate/test/abstractembeddedcomponents/propertyref/AbstractComponentPropertyRefTest
  • org/hibernate/test/bidi/AuctionTest
  • org/hibernate/test/formulajoin/FormulaJoinTest
  • org/hibernate/test/cuk/CompositePropertyRefTest
  • org/hibernate/test/propertyref/inheritence/joined/JoinedSubclassPropertyRefTest

Property-ref to attribute in super-EntityBinding:

  • org/hibernate/test/propertyref/inheritence/discrim/SubclassPropertyRefTest.java

laziness is not correctly set

  • org/hibernate/test/collection/original/CollectionTest.testExtraLazy
  • org/hibernate/test/legacy/OneToOneCacheTest.java

NAMED QUERIES

Named SQLQuery

  • org/hibernate/test/annotations/query/QueryAndSQLTest

ASSOCIATIONS

@OneToOne with mappedBy specified

  • org.hibernate.test.annotations.derivedidentities.bidirectional.OneToOneWithDerivedIdentityTest
  • org/hibernate/test/annotations/manytoone/ManyToOneJoinTest.java
  • org/hibernate/test/annotations/manytoone/ManyToOneTest.java
  • org/hibernate/test/annotations/entity/BasicHibernateAnnotationsTest.java
  • org/hibernate/test/annotations/naturalid/ImmutableNaturalKeyLookupTest.java
  • org/hibernate/test/annotations/onetoone/hhh4851/HHH4851Test.java
  • org/hibernate/test/annotations/onetoone/primarykey/NullablePrimaryKeyTest
  • org/hibernate/test/annotations/onetoone/OneToOneTest.java
  • org/hibernate/test/annotations/onetoone/OptionalOneToOneMappedByTest
  • org/hibernate/test/annotations/onetoone/OptionalOneToOnePKJCTest.java

many-to-many

  • org/hibernate/test/annotations/quote/QuoteGlobalTest.java
  • org/hibernate/test/annotations/target/TargetTest.java

INHERITANCE

Joined-subclass is not supported yet

  • org/hibernate/test/legacy/MultiTableTest.java
JoinedSubclassEntityPersister.tableKeyColumns is null
  • org.hibernate.test.criteria.CriteriaQueryTest#testCriteriaCollectionOfValue
  • org/hibernate/test/hql/ASTParserLoadingOrderByTest
  • org/hibernate/test/hql/BulkManipulationTest
  • org/hibernate/test/hql/WithClauseTest

index constarint creation (HHH-8262)

  • org.hibernate.test.legacy.ABCTest#testHigherLevelIndexDefinition

Named query binding

  • org/hibernate/test/annotations/inheritance/joined/JoinedSubclassAndSecondaryTable.java

  • org/hibernate/test/annotations/inheritance/joined/JoinedSubclassTest.java

  • org/hibernate/test/annotations/inheritance/mixed/SubclassTest.java

  • org/hibernate/test/annotations/inheritance/SubclassTest.java

  • org/hibernate/test/annotations/JoinedSubclassTest.java

Non-JPA:

  • org/hibernate/test/hql/ASTParserLoadingTest (uses many-to-any)
  • org/hibernate/test/annotations/any/AnyTest.java
  • org/hibernate/test/entitymode/map/basic/DynamicClassTest.java
  • org/hibernate/test/entitymode/map/subclass/SubclassDynamicMapTest.java
  • org/hibernate/test/onetoone/nopojo/DynamicMapOneToOneTest.java

A mapped superclass cannot extend an entity:

  • org/hibernate/test/annotations/entitynonentity/EntityNonEntityTest.java
  • org/hibernate/test/annotations/mappedsuperclass/intermediate/IntermediateMappedSuperclassTest.java

The annotation property [XXX] of annotation [@YYY] is not of type ZZZ

  • org/hibernate/test/annotations/onetomany/OneToManyTest.java

NotFound.IGNORE (HHH-7916)

  • org/hibernate/test/annotations/notfound/NotFoundTest.java
  • org.hibernate.test.unconstrained.UnconstrainedTest
  • org.hibernate.test.collection.original.CollectionTest

Generic Collection

the collection attribute with generic is not handled well, esp when it is a composited collection with generic @Embeddable

  • org/hibernate/test/annotations/generics/EmbeddedGenericsTest.java
  • org/hibernate/test/annotations/generics/GenericsTest.java

Plural Attribute Laziness

see org.hibernate.metamodel.internal.source.hbm.AbstractPluralAttributeSourceImpl#getFetchTiming and org.hibernate.cfg.HbmBinder#initOuterJoinFetchSetting

  • org/hibernate/test/immutable/entitywithmutablecollection/inverse/EntityWithInverseOneToManyTest.java
  • org/hibernate/test/immutable/entitywithmutablecollection/inverse/VersionedEntityWithInverseOneToManyTest.java

Custom Collection Type is not working

The problem is in this method, at least kind of org.hibernate.metamodel.internal.HibernateTypeHelper#bindHibernateTypeDescriptor,

In this method, if the passed in resolvedType is not null, then we assume it is the type and just ignore the explicitTypeName.

for Ann, the @CollectionType is not bindded at all.

  • org/hibernate/test/collection/custom/basic/UserCollectionTypeAnnotationsVariantTest.java

  • org/hibernate/test/collection/custom/basic/UserCollectionTypeHbmVariantTest.java

  • org/hibernate/test/collection/custom/parameterized/ParameterizedUserCollectionTypeAnnotationsVariantTest.java

  • org/hibernate/test/collection/custom/parameterized/ParameterizedUserCollectionTypeHbmVariantTest.java

  • org/hibernate/test/sql/hand/query/NativeSQLQueriesTest.java

    this is actually a custom user type issue, it uses a custom UserType as a composite attribute's type, where runs into org.hibernate.metamodel.internal.HibernateTypeHelper#bindJdbcDataType and this method checks only if the type is an instance of CompositeType, doesn't check CompositeUserType nor UserType at all.

TBD

  • org/hibernate/test/annotations/indexcoll/MapKeyTest.java

  • org/hibernate/test/annotations/indexcoll/IndexedCollectionTest.java

  • org/hibernate/test/annotations/manytoonewithformula/ManyToOneWithFormulaTest.java

  • org/hibernate/test/annotations/override/AttributeOverrideTest.java

    @AttributeOverrides on @ElementCollection is not working when the element type is embeddable

  • org/hibernate/test/annotations/quote/resultsetmappings/ExplicitSqlResultSetMappingTest.java

  • org/hibernate/test/annotations/referencedcolumnname/ReferencedColumnNameTest.java

  • org/hibernate/test/annotations/xml/ejb3/Ejb3XmlTest.java

  • org/hibernate/test/annotations/xml/ejb3/OrmVersion1SupportedTest.java

  • org/hibernate/test/immutable/entitywithmutablecollection/noninverse/VersionedEntityWithNonInverseOneToManyTest.java

  • org/hibernate/test/legacy/MapTest.java

  • org/hibernate/test/manytomanyassociationclass/surrogateid/generated/ManyToManyAssociationClassGeneratedIdTest.java

  • org/hibernate/test/propertyref/DoesNotWorkWithHbmTest.java

  • org/hibernate/test/annotations/strategy/StrategyTest.java

    The entity used in this test has the follow unique constraint @Table(uniqueConstraints = {@UniqueConstraint(columnNames = {"start.country", "start.city"})}) , it uses a attribute path ( aka, logical column name in the old metamodel ) to define the constraint column name, it used to work fine, we have org.hibernate.cfg.Configuration.MappingsImpl.TableColumnNameBinding that maintaining the logical column name and physical column name mapping.

    But in the new metamodel, we don't have such concept, so when creating unique constraint, it can't find the column and then have no choice but creating new one, which caused duplicated columns.

    It seems incorrect to use attribute path here, according to the JPA SPEC, but hard to tell if we should "correct" this, since we don't know if it will cause imcompatibility issue, I'd like to get this fixed and make migration easier.