Specify SQL Server IGNORE_DUP_KEY with Java Persistence API

I’m using Microsoft SQL Server with ebean.

One of my entities has a unique constraint which I can add with JPA annotation javax.persistence.UniqueConstraint.

Is there a way to specify IGNORE_DUP_KEY for the unique constraint in Java? (Ideally using JPA annotations).

My current workaround is to run a SQL script with ebeans ScriptRunner which adds the WITH (IGNORE_DUP_KEY=ON) part, but would prefer it was done through the ORM.

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.