Skip to content

Problems and Concerns with Unified Schema

Steve Ebersole edited this page May 29, 2014 · 28 revisions
  • Mismatch in that hbm.xml did not require "mapped superclass" to be explicit. See tests in ehcache related to Item/VersionedItem as an example. This is an issue when we transform hbm mappings that map whose field/methods are on the superclass.

    One solution is to create the <mapped-superclass/> in these cases.

  • Not many unit tests directly use the new schema. Nearly all are still HBM and rely on the transformer. New tests need developed.

    The plan in my head is to complete the transformer, and then to code the build-time tasks and use it to transform all the existing HMB mappings; from there we would develop tests for specific problems with the tranformer.

  • Envers tests temporarily disabled under HHH-7490. See EnversJaxbRootProducer#addDocument and https://github.com/hibernate/hibernate-orm/commit/51d09c53cb2840bce4810657e33b6eea87bccddc#diff-5c01302b0d7f69715938704aa13e895cR162. There was still some ongoing discussion about what exactly Envers should provide. It's own jaxb bindings?

    Well the "problem" here is that Gail wanted to do this as an intermediate step where envers would produce HBM (either as DOM or as JAXB is really largely irrelevant). Ultimately I think envers should produce bindings as in org.hibernate.metamodel.spi.binding

  • OSGi tests temporarily disabled under HHH-9173. Will re-evaluate once core and entitymanager are in a better place.

    Hard to say, as you don't mention any specific problems

  • multiple mappings of the same class, using different entity names (HBM's concept of "entity name" in general isn't really supported by JPA) org.hibernate.test.idgen.enhanced.sequence.BasicSequenceTest#testSequencePerEntity() org.hibernate.test.loadplans.plans.LoadPlanStructureAssertionTest org.hibernate.test.mixed.MixedTest org.hibernate.test.optlock.OptimisticLockTest

    But the schema should support this. I made the /entity@class attribute optional in the unified schema (in JPA orm.xml xsd it is required). The XSD also has /entity@name attribute; the open question there being whether we can use this as the HBM entity name, or do we need a separate /entity@entity-name attribute?

  • extra laziness org.hibernate.metamodel.spi.binding.UnidirectionalManyToManyBindingTests org.hibernate.metamodel.spi.binding.basiccollections.HbmBasicCollectionBindingTests org.hibernate.metamodel.spi.binding.onetomany.HbmUnidirectionalOneToManyBindingTests org.hibernate.test.jpa.fetch.FetchingTest#testJoinedOneToOne()

    That should be the hbm-fetch-mode attribute. I saw it on some of the collection mappings; did I miss it one others?

  • <timestamp.../> org.hibernate.metamodel.spi.binding.UnsavedValueHbmTests org.hibernate.test.component.basic.ComponentTest org.hibernate.test.legacy.SQLFunctionsTest org.hibernate.test.ops.CreateTest org.hibernate.test.ops.DeleteTest org.hibernate.test.ops.MergeTest org.hibernate.test.stateless.StatelessSessionTest org.hibernate.test.timestamp.TimestampTest

    Again, the schema should support this already. <timestamp/> is exactly the same as @Version @Temporal(..) which in xml is <version ...>...<temporal .../></version>

  • <...proxy=""> org.hibernate.test.annotations.xml.hbm.HbmWithIdentityTest org.hibernate.test.interfaceproxy.InterfaceProxyTest#testInterfaceProxies()

    Again, schema has this already... /entity@lazy + /entity@proxy

  • New schema only defines batch-size at the class level, not collections. org.hibernate.test.batchfetch.BatchFetchTest org.hibernate.test.manytomany.batchload.BatchedManyToManyTest org.hibernate.test.version.db.DbVersionTest org.hibernate.test.where.WhereTest

  • MultipleBagFetchException (bags appear to be transformed and mocked properly, so a bit confused about the cause) org.hibernate.test.cid.CompositeIdTest#testCompositeIds() org.hibernate.test.cid.CompositeIdTest#testMultipleCollectionFetch()

  • formulas as map keys org.hibernate.test.collection.map.PersistentMapTest org.hibernate.test.extralazy.ExtraLazyTest org.hibernate.test.joinfetch.JoinFetchTest org.hibernate.test.map.MapIndexFormulaTest

  • association formulas org.hibernate.test.jpa.fetch.FetchingTest#testSpecialOneToOne() org.hibernate.test.loadplans.process.NonEncapsulatedCompositeIdResultSetProcessorTest org.hibernate.test.loadplans.walking.KeyManyToOneWalkingTest org.hibernate.test.manytomany.ManyToManyTest org.hibernate.test.mapelemformula.MapElementFormulaTest org.hibernate.test.onetoone.formula.OneToOneFormulaTest org.hibernate.test.typedmanytoone.TypedManyToOneTest org.hibernate.test.unconstrained.UnconstrainedTest

  • EntityMode.MAP org.hibernate.test.entitymode.map.basic.DynamicClassTest org.hibernate.test.legacy.MapTest org.hibernate.test.onetoone.nopojo.DynamicMapOneToOneTest org.hibernate.test.tm.CMTTest

  • appears using component.field as the association path is failing org.hibernate.test.fetchprofiles.join.JoinFetchProfileTest

  • <filter> within a collection org.hibernate.test.filter.DynamicFilterTest org.hibernate.test.subclassfilter.DiscrimSubclassFilterTest

  • joined subclass not receiving columns defined by superclass org.hibernate.test.filter.hql.JoinedFilteredBulkManipulationTest#testFilteredJoinedSubclassHqlDeleteLeaf() org.hibernate.test.filter.hql.JoinedFilteredBulkManipulationTest#testFilteredJoinedSubclassHqlDeleteNonLeaf() org.hibernate.test.filter.hql.JoinedFilteredBulkManipulationTest#testFilteredJoinedSubclassHqlUpdateLeaf() org.hibernate.test.filter.hql.JoinedFilteredBulkManipulationTest#testFilteredJoinedSubclassHqlUpdateNonLeaf()

  • joined subclass not receiving filters defined by superclass org.hibernate.test.subclassfilter.JoinedSubclassFilterTest

  • hbm <join> org.hibernate.test.hql.ASTParserLoadingOrderByTest org.hibernate.test.hql.CriteriaHQLAlignmentTest org.hibernate.test.hql.ScrollableCollectionFetchingTest org.hibernate.test.hql.WithClauseTest org.hibernate.test.immutable.entitywithmutablecollection.inverse.VersionedEntityWithInverseOneToManyJoinFailureExpectedTest org.hibernate.test.immutable.entitywithmutablecollection.noninverse.EntityWithNonInverseOneToManyJoinTest org.hibernate.test.immutable.entitywithmutablecollection.noninverse.VersionedEntityWithNonInverseOneToManyJoinTest org.hibernate.test.join.JoinTest org.hibernate.test.join.OptionalJoinTest org.hibernate.test.onetomany.OneToManyTest org.hibernate.test.onetoone.link.OneToOneLinkTest

    <join/> is equivalent to <secondary-table/>. What specifically is the problem here?

  • The following all use variations of the same mapping, but it seems really off. Ex: Many of the classes have an inverse w/ a but the Info class has no associations, Contract#parties should probably be inverse, etc. Re-evaluate the whole mapping. org.hibernate.test.immutable.entitywithmutablecollection.inverse.EntityWithInverseManyToManyTest org.hibernate.test.immutable.entitywithmutablecollection.inverse.VersionedEntityWithInverseManyToManyTest org.hibernate.test.immutable.entitywithmutablecollection.noninverse.EntityWithNonInverseManyToManyTest org.hibernate.test.immutable.entitywithmutablecollection.noninverse.EntityWithNonInverseOneToManyTest org.hibernate.test.immutable.entitywithmutablecollection.noninverse.VersionedEntityWithNonInverseManyToManyTest org.hibernate.test.immutable.entitywithmutablecollection.noninverse.VersionedEntityWithNonInverseOneToManyTest

  • mapping looks off: Membership and subclass have Serializable id, but mapping uses type=long org.hibernate.test.manytomanyassociationclass.surrogateid.generated.ManyToManyAssociationClassGeneratedIdTest

  • select-before-update org.hibernate.test.interceptor.InterceptorTest#testInitiateIntercept() org.hibernate.test.interceptor.InterceptorTest#testPrepareStatementIntercept() org.hibernate.test.interceptor.InterceptorTest#testPropertyIntercept() org.hibernate.test.interceptor.InterceptorTest#testPropertyIntercept2()

    Its there... /entity/select-before-update

  • metamodel doesn't appear to be able to handle the composite-id key-many-to-one's on-delete (translated to @OnDelete) org.hibernate.test.keymanytoone.unidir.ondelete.KeyManyToOneCascadeDeleteTest

  • many-to-* w/ orphan removal org.hibernate.test.orphan.manytomany.ManyToManyOrphanTest org.hibernate.test.orphan.one2one.fk.composite.DeleteOneToOneOrphansTest org.hibernate.test.orphan.one2one.fk.reversed.unidirectional.DeleteOneToOneOrphansTest#testOrphanedWhileManaged() org.hibernate.test.orphan.one2one.fk.reversed.unidirectional.DeleteOneToOneOrphansTest#testReplacedWhileManaged()

    Probably many-to* here is a misnomer. Not all many-to-* support orphan removal; only collections and one-to-one.

  • for some reason, the SF statistics are off -- not sure if it's due to insertable/updatable, cascading, etc., all of which are working elsewhere org.hibernate.test.readonly.ReadOnlyVersionedNodesTest#*

  • named query return-join org.hibernate.test.resulttransformer.ResultTransformerTest

    Yeah, this is missing; JPA does not support this in result-set-mapping. We'll need to add

  • <import> (not sure what that would translate to) org.hibernate.test.stats.StatsTest

    It's there... /entity-mappings/import

  • no support for JaxbInheritanceType.UNION_SUBCLASS org.hibernate.test.unionsubclass.UnionSubclassTest org.hibernate.test.unionsubclass.alias.SellCarTest org.hibernate.test.unionsubclass2.UnionSubclassTest

    Yep, we'll need to add that (somehow)

  • UNINVESTIGATED org.hibernate.jpa.test.jee.OrmVersionTest org.hibernate.jpa.test.ops.GetLoadTest org.hibernate.jpa.test.ops.MergeTest org.hibernate.jpa.test.ops.PersistTest org.hibernate.jpa.test.packaging.PackagedEntityManagerTest#testExplodedPar() org.hibernate.jpa.test.packaging.PackagedEntityManagerTest#testListenersDefaultPar() org.hibernate.jpa.test.xml.XmlAttributeOverrideTest#testDefaultEventListener() org.hibernate.jpa.test.xml.sequences.XmlTest org.hibernate.test.annotations.xml.ejb3.NonExistentOrmVersionTest org.hibernate.test.cache.infinispan.functional.BasicTransactionalTestCase#testQueryCacheInvalidation() org.hibernate.test.hql.BulkManipulationTest org.hibernate.test.mappingexception.MappingExceptionTest#testNotFound() org.hibernate.test.ondelete.OnDeleteTest org.hibernate.test.typeparameters.TypeParameterTest#testSave org.hibernate.test.version.VersionTest#testCollectionVersion()