# How to use Oracle Hint in Hibnernate/JPA insert Query

**URL:** <https://discourse.hibernate.org/t/how-to-use-oracle-hint-in-hibnernate-jpa-insert-query/2552>\
**Category:** Hibernate ORM\
**Created:** [April 1, 2019, 5:01pm UTC](https://discourse.hibernate.org/t/how-to-use-oracle-hint-in-hibnernate-jpa-insert-query/2552 "2019-04-01T17:01:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alagammal](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@Alagammal](https://discourse.hibernate.org/u/Alagammal)\
**Post date:** [April 1, 2019, 5:01pm UTC](https://discourse.hibernate.org/t/how-to-use-oracle-hint-in-hibnernate-jpa-insert-query/2552/1 "2019-04-01T17:01:50Z")

</div>

I want to use IGNORE\_ROW\_ON\_DUPKEY\_INDEX Hint in the insert query ([https://docs.oracle.com/cd/E11882\_01/server.112/e41084/sql\_elements006.htm#CHDEGDDG](https://docs.oracle.com/cd/E11882_01/server.112/e41084/sql_elements006.htm#CHDEGDDG))

Is there a way to use the hint in HQL/JPA Query other than using nativeQuery option?

Query:

insert /\*+ ignore\_row\_on\_dupkey\_index(demo\_test,c\_cons1) \*/ into demo\_test values (100,‘xyz’);

---

<div class="post-metadata">

**Author:** ![p3consulting](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/p3consulting/32/565_2.png) [@p3consulting](https://discourse.hibernate.org/u/p3consulting)\
**Post date:** [April 7, 2019, 6:38am UTC](https://discourse.hibernate.org/t/how-to-use-oracle-hint-in-hibnernate-jpa-insert-query/2552/2 "2019-04-07T06:38:32Z")

</div>

you can create your own Interceptor by extending org.hibernate.EmptyInterceptor and overwriting onPrepareStatement.
