quarkus
quarkus copied to clipboard
javax.persistence.validation.mode=NONE not work [reactive]
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?
Help, pls
/cc @DavideD, @gavinking
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 I tried this but it didn't help
Adding quarkus.hibernate-orm.validate-in-dev-mode=false resolved the issue for me
@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
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.
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