[hibernate-dev] 6.0 - Type redesign

Steve Ebersole steve at hibernate.org
Fri Jun 24 11:58:30 EDT 2016


I worked on this some more today and wanted to pass along a few high-points
I started to see emerge...

The idea of "Type scoping" is very important and central.  The basic idea
is to have a single point for the creation and caching of Type instances.
Specifically this Scope would define just 2 methods and would be passed to
any Type that requested access to the Scope (however we decide that
"requested access" should look: annotation, interface, etc):

   1. It would give access to the org.hibernate.engine.spi.Mapping
   reference which is implemented for both boot-time
   (org.hibernate.boot.Metadata) and run-time (SessionFactory, though I'd like
   to move that to the SessionFactory's Metamodel delegate).
   2. It would give access to  SessionFactory, but an exception would be
   thrown if the #resolveFactory method is called before the SessionFactory
   is bound to the Scope.

(1) is the new pieces I am proposing.  (2) is what Scope does today.

The discussion about removing the Type method overloads around passing
Mapping and SessionFactory as arguments is something I'd like to hear
people's opinions about.

In a way I do think we ought to look at this as a chance to
GetTypeRight(tm).  Essentially there is a lot of change here not matter
what, so we ought to not be afraid to design in a clean-room for
Type-related code in 6.0.

On Wed, Jun 22, 2016 at 11:54 AM Steve Ebersole <steve at hibernate.org> wrote:

> I started a wiki discussing the proposal for the type system redesign.
> Let's get discussions about it starter sooner rather than later.  Thanks!
>
> https://github.com/hibernate/hibernate-orm/wiki/6.0---Type-redesign
>


More information about the hibernate-dev mailing list