开发者

JPA validation API

开发者 https://www.devze.com 2023-03-05 20:54 出处:网络
Does JPA contains any validation API? E.g. email property validation like this in hibernate validation:

Does JPA contains any validation API?

E.g. email property validation like this in hibernate validation:

@Email
public Strin开发者_如何转开发g getUserEmail() {
  ...
}


Bean Validation (JSR303) can be used nicely alongside JPA, but is a separate API. This is a very brief introduction to Bean Validation itself, and see this for how an introduction of how it can be used with JPA.

Note: Similar to JPA, you will have to pick an implementation, of which there are many. Hibernate Validator is the reference implementation.

0

精彩评论

暂无评论...
验证码 换一张
取 消