Yes, configuration is only via persistence.xml. I guess it would be open for JPA implementations to provide implementation specific ways, but that's not standardized. I am not sure whether OpenJPa offers such a provider specific option, but I don't think so.
Specify bean validation group prior to merge/persist?
-
30-06-2022 - |
Pregunta
How (or can) I specify programmatically which validation group OpenJPA should validate against during a persist or merge operation? Is this option only available via persistence.xml?
I'm drawing a blank.
Thanks.
Solución 2
Otros consejos
The groups are configured per entity manager factory. If you obtain your entity manager factory programmatically via Persistence#createEntityManagerFactory()
you can pass the groups to be validated during lifecycle validation using the properties javax.persistence.validation.group.{pre-persist|pre-update|pre-remove}
but there is no (standardized) way for specifying the groups on a per-operation basis.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow