开发者

JPA validation API

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜