如何休眠验证可选值?

时间:2013-10-24 12:10:42

标签: java regex hibernate hibernate-validator

如何创建一个值应遵循以下规则的hibernate验证注释:

//should be: either empty, or if it has a value, it sould only be "A" or "B"
@Pattern(regex = "???")
String value;

0 个答案:

没有答案