hibernate validator - different groups on create, update, delete

后端 未结 1 1186
[愿得一人]
[愿得一人] 2021-01-18 23:20

Using bean validation, particular hibernate validator implementation is it possible to define certain groups to automatically be used on certain crud operations like create

1条回答
  •  北恋
    北恋 (楼主)
    2021-01-19 00:10

    You're probably looking for "Hibernate event-based validation" under "ORM Integration". You can set properties to specify which groups to validate at different times by setting properties on the SessionFactory like so:

    javax.validation.Default
    javax.validation.Default
    
    

    The above is the default configuration if you don't specify anything. Specifically, the javax.validation.Default group is validated on creates and updates. Nothing is validated on deletes.

    0 讨论(0)
提交回复
热议问题