williamsandonz
williamsandonz

Reputation: 16420

Hibernate validator how to validate the object including its related objects?

I have a Event class, with many to one Person objects associated with it, (which in turn has its own validator annoations on it. When I validate my Event class though, it's not calling the validation on the related object?

Set<ConstraintViolation<Event>> cv = getValidator().validate(i);

Upvotes: 1

Views: 250

Answers (1)

ben_w
ben_w

Reputation: 736

Annotate the Person field in Event with @Valid to have the validation also validate the Person instance.

Upvotes: 3

Related Questions