# Object owner in nullSafeGet() method UserType is always null

**URL:** <https://discourse.hibernate.org/t/object-owner-in-nullsafeget-method-usertype-is-always-null/8139>\
**Category:** Hibernate ORM\
**Created:** [August 18, 2023, 7:09am UTC](https://discourse.hibernate.org/t/object-owner-in-nullsafeget-method-usertype-is-always-null/8139 "2023-08-18T07:09:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![inflo](https://avatars.discourse-cdn.com/v4/letter/i/c67d28/32.png) [@inflo](https://discourse.hibernate.org/u/inflo)\
**Post date:** [August 18, 2023, 7:09am UTC](https://discourse.hibernate.org/t/object-owner-in-nullsafeget-method-usertype-is-always-null/8139/1 "2023-08-18T07:09:54Z")

</div>

Hi. In hibernate 6 when i implement **UserType** i must implement method **nullSafeGet**. The last parameter of this method **owner** is always null  
Click FindUsages on this method and we will see:

```auto
@Override
		public J extract(ResultSet rs, int paramIndex, WrapperOptions options) throws SQLException {
			final J extracted = userType.nullSafeGet( rs, paramIndex, options.getSession(), null );
			logExtracted( paramIndex, extracted );
			return extracted;
		}

```

IMHO if it should always be null then maybe better is remove this parameter because, it doesn’t give any information, it only confuses that it can be used like in version 5 of hibernate

---

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [August 21, 2023, 8:33am UTC](https://discourse.hibernate.org/t/object-owner-in-nullsafeget-method-usertype-is-always-null/8139/2 "2023-08-21T08:33:18Z")

</div>

You can create a JIRA ticket for this if you want. We are open to improvements, but since `UserType` is an API, any changes must be backwards compatible. To achieve that, we could add new method overloads for `nullSafeGet` and `nullSafeSet` with a default implementation that delegates to the existing methods which should also be deprecated. Removal of the old methods would only be possible in the next major version.

---

<div class="post-metadata">

**Author:** ![inflo](https://avatars.discourse-cdn.com/v4/letter/i/c67d28/32.png) [@inflo](https://discourse.hibernate.org/u/inflo)\
**Post date:** [August 22, 2023, 8:41am UTC](https://discourse.hibernate.org/t/object-owner-in-nullsafeget-method-usertype-is-always-null/8139/3 "2023-08-22T08:41:34Z")

</div>

I create Jira [[HHH-17114] - Hibernate JIRA](https://hibernate.atlassian.net/browse/HHH-17114)
