[hibernate-dev] 6.0 - Type redesign

Jordan Gigov coladict at gmail.com
Mon Oct 24 16:10:37 EDT 2016


2016-10-20 21:27 GMT+03:00 Steve Ebersole <steve at hibernate.org>:
>
>> A type should be able to define classes Interfaces and Abstract
>> classes that it can handle in their Java types.
>> This will enable implementing handlers for things like javax.script.*
>> objects that can have different providers, thus different class names
>> of the final object.
>> That would have to be a secondary check if no match is found by Java
>> class name, because it's slower and dangerous when binding
>> parameters to a query.
>
>
> I am not sure what you are talking about here.
>
>
>> If stored as Class object references, they would have to be held in
>> WeakReference objects tied to a ReferenceQueue, so as not to
>> prevent garbage collection when a context is unloaded in a multi-context
>> server.
>>
>> If stored as Strings, there would have to be a call to Class.forName
>> for each, which if successful would have to check isInstance on the
>> object or isAssignableFrom on it's class (when evaluating DB model).
>
>
> Again, not really sure what you are talking about here.  I guess you mean in
> some "cache" based on the Java type handled?
>

I am talking about type registration and resolution in both. Right now,
they're being registered in
org.hibernate.boot.model.process.spi.MetadataBuildingProcess#handleTypes
which creates a BasicTypeRegistry for resolving them.
In the current state, they can only be registered by full class name.
I'm proposing that they can optionally register interfaces.


> Statement also gives you access to the Connection (Statement#getConnection)
>
Which JavaTypeDescriptor wrap and unwrap have no access to under the old model.

> In general a lot of points are just out of date.  If you want to influence
> the development of this or be part of it you should consider joining the
> HipChat channel where we discuss this stuff.  I stopped trying to discuss
> here because no one generally answers.
>
By HipChat do you mean the IRC #hibernate channel on Freenode?
If not, the Community page has no mention of HipChat.
Time zone differences would likely make that a poor choice for me. I'm
in the EET zone.


More information about the hibernate-dev mailing list