Skip to content

6.0 persister redesign

Steve Ebersole edited this page Jul 17, 2016 · 3 revisions

See also the https://github.com/hibernate/hibernate-orm/wiki/6.0---Type-redesign page. A further aspect of the Type redesign is redesigning the persister contracts.

ORM meeting Monday to start discussing this work...


Initial thoughts...


The idea of persister (EntityPersister and CollectionPersister) has always been 2-fold:

  • Metadata about the thing (entity/collection)
  • Persistence-related calls for the thing

Some goals for this work include:

  • Redesign the metadata aspect. I say redesign, but really the initial "design" grew organically with no (little) up front plan/design
  • Defining a new "persister" for composites/embeddables
  • Decide about splitting these concerns or leaving them combined
  • Decide what to do with the persistence aspect.

In terms of the metadata aspect, I'd like to align with the JPA design and the SQM design (which is heavily influenced by the JPA design). Not because I think the JPA design is any better (in fact it is not as good in some ways), but more because (1) it is well understood and (2) represents a least-common-denominator as far as its design focus.

I'd also like to take some of the ideas originally developed in the metamodel branch work wrt hierarchy modeling.


In JPA EntityType models what we would historically call the persister, whereas the historical Hibernate EntityType would model a specific use of that entity (a one-to-one, many-to-one, any, etc). This is the "least-common-denominator" aspect discussed above. We obviously ultimately need both. The metadata about a specific usage would be relative to a (Singular)Attribute. I think that is the most appropriate "mental model" given all requirements.