# JdbcDateTypeDescriptor

**URL:** <https://discourse.hibernate.org/t/jdbcdatetypedescriptor/764>\
**Category:** Hibernate ORM\
**Created:** [May 15, 2018, 7:03pm UTC](https://discourse.hibernate.org/t/jdbcdatetypedescriptor/764 "2018-05-15T19:03:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Philippe\_Marschall](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/philippe_marschall/32/554_2.png) [@Philippe\_Marschall](https://discourse.hibernate.org/u/Philippe_Marschall)\
**Post date:** [May 15, 2018, 7:03pm UTC](https://discourse.hibernate.org/t/jdbcdatetypedescriptor/764/1 "2018-05-15T19:03:47Z")

</div>

I struggling to understand org.hibernate.type.descriptor.java.JdbcDateTypeDescriptor. There are two issues I don’t understand.

1. Why is the type parameter is java.util.Date and not java.sql.Date? I get the impression that org.hibernate.type.descriptor.java.DateTypeDescriptor is intended for java.util.Date and org.hibernate.type.descriptor.java.JdbcDateTypeDescriptor is intended for java.sql.Date
2. org.hibernate.type.descriptor.java.JdbcDateTypeDescriptor.wrap(X, WrapperOptions) returns a java.util.Date if a java.util.Date is passed in, otherwise a java.sql.Date is returned. That means when a java.sql.Timestamp is passed in the very same instance is returned.

---

<div class="post-metadata">

**Author:** ![vlad](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/vlad/32/658_2.png) [@vlad](https://discourse.hibernate.org/u/vlad)\
**Post date:** [May 15, 2018, 7:20pm UTC](https://discourse.hibernate.org/t/jdbcdatetypedescriptor/764/2 "2018-05-15T19:20:04Z")

</div>

That’s a good question. Maybe we need to review the code and see if we need to make the `JdbcDateTypeDescriptor` comply to handling `java.sql.Date` and not mix it with `java.util.Date`.

Plewase open a Jira issue for this.

---

<div class="post-metadata">

**Author:** ![Philippe\_Marschall](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/philippe_marschall/32/554_2.png) [@Philippe\_Marschall](https://discourse.hibernate.org/u/Philippe_Marschall)\
**Post date:** [May 15, 2018, 10:13pm UTC](https://discourse.hibernate.org/t/jdbcdatetypedescriptor/764/3 "2018-05-15T22:13:07Z")

</div>

There you go [HHH-12586](https://hibernate.atlassian.net/browse/HHH-12586)

---

<div class="post-metadata">

**Author:** ![vlad](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/vlad/32/658_2.png) [@vlad](https://discourse.hibernate.org/u/vlad)\
**Post date:** [May 16, 2018, 7:45am UTC](https://discourse.hibernate.org/t/jdbcdatetypedescriptor/764/4 "2018-05-16T07:45:08Z")

</div>

Thanks for filling the issue.
