[hibernate-dev] org.hibernate.persister.spi.PersisterFactory and 5.0

Steve Ebersole steve at hibernate.org
Wed Nov 26 19:23:44 EST 2014


Part of the goals for ORM 5.0 is moving from Configuration to the
ServiceRegistry+Metadata for building a SessionFactory.

One of the points I ran into that will have to change
is org.hibernate.persister.spi.PersisterFactory.  The problems is that
PersisterFactory accepts a Configuration as part of building
CollectionPersisters.  The need for Configuration in the standard
CollectionPersister impls is amazingly trivial; we literally use it to
locate the associated entity's PersistentClass to grab the classes dom4j
node name, and this is right after we have just resolved the corresponding
EntityPersister.  The point being that the standard CollectionPersisters
really don't need access to the Configuration.

I am pretty sure OGM provides a custom PersisterFactory, or is it just
the PersisterClassResolver that OGM provides?  Also, I would assume OGM is
providing custom CollectionPersister impls.  This change would affect both
usages.

I wanted y'all to be aware of this upcoming change.  But I also wanted to
start a discussion about what the signature(s) should become.  Currently we
pass:

* Configuration
* Collection (the parsed mapping info)
* CollectionRegionAccessStrategy
* SessionFactoryImplementor


I suggest we pass:

* Collection
* CollectionRegionAccessStrategy
* SessionFactoryImplementor
* Mapping

(I changed order to align with the order for building EntityPersisters)

Mapping is org.hibernate.engine.spi.Mapping which is part of
Configuration.  I decided to (at least temporarily) port this contract
forward to ease migration.  Metadata implements it.

There is a similar discussion to be had wrt Integrators.  I will follow up
with an email specific to them later.


More information about the hibernate-dev mailing list