quarkus icon indicating copy to clipboard operation
quarkus copied to clipboard

javax.persistence.validation.mode=NONE not work [reactive]

Open uPagge opened this issue 3 years ago • 8 comments

Discussed in https://github.com/quarkusio/quarkus/discussions/22129

Originally posted by uPagge December 12, 2021 Hello i can't figure out how to set javax.persistence.validation.mode on reactive hibernate? i tried to use persistence.xml but it cannot be used with reactive approach? How do I turn off database-level validation?

uPagge avatar Dec 15 '21 03:12 uPagge

Help, pls

uPagge avatar Dec 28 '21 07:12 uPagge

/cc @DavideD, @gavinking

quarkus-bot[bot] avatar Jan 12 '22 09:01 quarkus-bot[bot]

No you can't use a persistence.xml. Did you try using quarkus.hibernate-orm.database.generation=none ?

See https://quarkus.io/guides/hibernate-orm#quarkus-hibernate-orm_quarkus.hibernate-orm.database.generation

Sanne avatar Jan 12 '22 09:01 Sanne

@Sanne I tried this but it didn't help

uPagge avatar Jan 18 '22 05:01 uPagge

Adding quarkus.hibernate-orm.validate-in-dev-mode=false resolved the issue for me

AndLvovSky avatar Jan 19 '22 11:01 AndLvovSky

@AndLvovSky It did not help, and what does it have to do with it? I need to disable validation only at the resistance level and not only in dev mode

uPagge avatar Jan 20 '22 12:01 uPagge

Maybe I'm wrong but it seems that right now the only way to set this property is via a persistence.xml. Because it doesn't work with Hibernate Reactive I don't think there is a way.

Would it be possible to add it as a new configuration property for hibernate-orm (and therefore reactive) in the application.properties? It should be bound to the persistence unit.

DavideD avatar Jan 20 '22 14:01 DavideD

In my case quarkus.hibernate-orm.validation.enabled=false didn't work (whatever quarkus.hibernate-orm.database.generation=none or not)

So what works is to forced it quarkus.hibernate-orm.unsupported-properties."javax.persistence.validation.mode"=none

ps: Quarkus 3.11.3

Dougniel avatar Jun 26 '24 17:06 Dougniel