[hibernate-dev] 6.0 - Proposed org.hibernate.mapping changes

Steve Ebersole steve at hibernate.org
Mon Feb 20 12:02:45 EST 2017


For 6.0, what do y'all think of these changes proposed below to the
org.hibernate.mapping package?

*Koen, this affects tools so really would like your thoughts...*

Mostly this comes from the definition of a `#finishInitialization` method
on ManagedTypeImplementor (which covers mapped-superclass, entity and
embeddable/embedded).  Currently this method takes its supertype as
PersistentClass; however PersistentClass is generally understood to model
an entity and tooling certainly uses it as such.  Keeping this in mind to
hopefully minimize impact I propose the following:


   1. Define a new org.hibernate.mapping.ManagedTypeMapping that represents
   mappings for any "managed type" in the normal JPA meaning of that term
   (mapped-superclass, entity, embeddable)
   2. Define a new org.hibernate.mapping.EmbeddedTypeMapping extending
   ManagedTypeMapping (org.hibernate.mapping.Composite). Or should we split
   EmbeddableTypeMapping and "EmbeddedMapping"?
   3. Define a new org.hibernate.mapping.IdentifiableTypeMapping extending
   ManagedTypeMapping
   4. Define a new org.hibernate.mapping.MappedSuperclassTypeMapping
   extending IdentifiableTypeMapping
   5. Define a new org.hibernate.mapping.EntityTypeMapping extending
   IdentifiableTypeMapping
   6. Make PersistentClass extend EntityTypeMapping and deprecate
   7. Make Composite extend EmbeddedTypeMapping and deprecate
   8. Make MapppedSuperclass extend MappedSuperclassTypeMapping and
   deprecate
   9. Re-work the hierarchies here to better fit this new model


    /**
     * ...
*
* @todo (6.0) Use ManagedTypeMapping here as super-type rather than
PersistentClass
*/
void finishInitialization(
            ManagedTypeImplementor<? super T> superType,
            PersistentClass entityBinding,
            PersisterCreationContext creationContext);


More information about the hibernate-dev mailing list