标签: 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;