Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hibernate validator在嵌套的自定义类型字段中失效 #46

Open
JavaCorren opened this issue May 18, 2020 · 1 comment
Open

hibernate validator在嵌套的自定义类型字段中失效 #46

JavaCorren opened this issue May 18, 2020 · 1 comment

Comments

@JavaCorren
Copy link

@DaTa
public class AddClassParams {

@NotNull(message = "班级信息不能为空")
@ApiModelProperty(value = "班级信息")
@FluentValid
private ClassParamsForInsert classInfo;

}

@DaTa
public class ClassParamsForInsert {

@NotNull(message = "班级名称不能为空")
@FluentValidate(value = {StringValidator.class})
@ApiModelProperty(value = "班级名称", example = "秋季1期低年级11班")
private String className;

@NotNull(message = "班主任id不能为空")
@ApiModelProperty(value = "班主任Id", example = "72608")
private Long counselorId;

@NotNull(message = "学期id不能为空")
@ApiModelProperty(value = "学期Id", example = "17")
private Long termId;

@ApiModelProperty(value = "售卖课程包Id", example = "1")
private Long coursePackageId;

}

@FluentValidate 可以生效,@NotNull之类的hibernate validator全部失效

@neoremind
Copy link
Owner

可以先确认去掉FluentValidate注解后,hibernate生效吗?怀疑是hibernate未生效导致的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants