Object owner is null after implementing UserType<J>

After migrating to hibernate 6.1.6-Final, We are getting null value for “Object owner” parameter in nullSafeGet method. On going inside the library I could see the calling method “extract” in UserTypeSqlTypeAdapter.class is passing null .

public J extract(ResultSet rs, int paramIndex, WrapperOptions options) throws SQLException {
J extracted = this.userType.nullSafeGet(rs, paramIndex, options.getSession(), (Object)null);
this.logExtracted(paramIndex, extracted);
return extracted;
}

We need to get the object type when nullSafeGet is called for all the attributes in the Class. We were able to get object type in hibernate 5.
Any way to do it ?

There is no way to get access to the owner object anymore. You can let the UserType implement org.hibernate.usertype.DynamicParameterizedType, then you can get information about the attribute for which the UserType is used and pre-compute all the type related information.

I have two questions here : 1. Why Do nullSafeGet still have Object owner paramter ? 2. Is there any way to pass a different value which is dynamically calculated by calling method ?

Why Do nullSafeGet still have Object owner paramter ?

I guess that was just an oversight and we should have removed it, but failed to notice this in time.

Is there any way to pass a different value which is dynamically calculated by calling method

No idea what that means, but as you can see in the Hibernate code base, the owner will always be null.