# Migration to SpringBoot 3: trunc a date with oracle driver no longer works (hibernate)

**URL:** <https://discourse.hibernate.org/t/migration-to-springboot-3-trunc-a-date-with-oracle-driver-no-longer-works-hibernate/7008>\
**Category:** Hibernate ORM\
**Created:** [December 12, 2022, 2:18pm UTC](https://discourse.hibernate.org/t/migration-to-springboot-3-trunc-a-date-with-oracle-driver-no-longer-works-hibernate/7008 "2022-12-12T14:18:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Helotrix](https://avatars.discourse-cdn.com/v4/letter/h/7cd45c/32.png) [@Helotrix](https://discourse.hibernate.org/u/Helotrix)\
**Post date:** [December 12, 2022, 2:18pm UTC](https://discourse.hibernate.org/t/migration-to-springboot-3-trunc-a-date-with-oracle-driver-no-longer-works-hibernate/7008/1 "2022-12-12T14:18:30Z")

</div>

I am currently migrating a SpringBoot 2.7 application to SpringBoot 3. The following query is used within a SpringData repository:

```auto

@Query("select b from #{#entityName} b where (trunc(b.date) <= trunc(:date))")
List<T> findByDate(LocalDateTime date);

```

While this works great in SpringBoot 2.7, with SpringBoot 3 the following message is thrown:

> org.hibernate.QueryException: Parameter 1 of function trunc() has type NUMERIC, but argument is of type java.time.LocalDateTime

Unfortunately, a simple migration to datetrunc was unsuccessful:

> Error Msg = ORA-00904: “DATETRUNC”: ungültige ID

Does anyone have a solution for this?

Best regards

---

<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:** [December 12, 2022, 2:22pm UTC](https://discourse.hibernate.org/t/migration-to-springboot-3-trunc-a-date-with-oracle-driver-no-longer-works-hibernate/7008/2 "2022-12-12T14:22:14Z")

</div>

Hey there. It seems that the `trunc` function has multiple overloads but Hibernate 6 only supports the numeric variant right now. Please create a JIRA issue for this bug.

---

<div class="post-metadata">

**Author:** ![Helotrix](https://avatars.discourse-cdn.com/v4/letter/h/7cd45c/32.png) [@Helotrix](https://discourse.hibernate.org/u/Helotrix)\
**Post date:** [December 12, 2022, 3:19pm UTC](https://discourse.hibernate.org/t/migration-to-springboot-3-trunc-a-date-with-oracle-driver-no-longer-works-hibernate/7008/3 "2022-12-12T15:19:22Z")

</div>

Thank you for your prompt reply. Issue was opened under HHH-15855.

---

<div class="post-metadata">

**Author:** ![Ranjeet\_Suman](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/ranjeet_suman/32/2382_2.png) [@Ranjeet\_Suman](https://discourse.hibernate.org/u/Ranjeet_Suman)\
**Post date:** [April 13, 2023, 7:37am UTC](https://discourse.hibernate.org/t/migration-to-springboot-3-trunc-a-date-with-oracle-driver-no-longer-works-hibernate/7008/4 "2023-04-13T07:37:55Z")

</div>

we have recently updated our application from Spring boot 2.x to 3.x . We are facing issue with Trunc a date .  
Could you please provide update on ticket which you have created on DEC 2022

---

<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:** [April 13, 2023, 10:25am UTC](https://discourse.hibernate.org/t/migration-to-springboot-3-trunc-a-date-with-oracle-driver-no-longer-works-hibernate/7008/5 "2023-04-13T10:25:54Z")

</div>

Hibernate is an open source project, so you can contribute a fix for this or pay someone to do so for you if this matter is so important to you. If you don’t want that, then you’ll simply have to wait until the Hibernate team has the time to fix this.
