This topic has not yet been written. The content below is from the topic description.
2.1.4. Constraint inheritance When validating an object that implements an interface or extends another class, all constraint annotations on the implemented interface and parent class apply in the same manner as the constraints specified on the validated object itself. To make things clearer let's have a look at the following example: Example 2.4. Constraint inheritance using RentalCar package com.mycompany; import javax.validation.constraints.NotNull; public class RentalCar extends Car { private String rentalStation; public RentalCar(String manufacturer, String rentalStation) { super(manufacturer); this.rentalStation = rentalStation; } @NotNull public String getRentalStation() { return rentalStation; } public void setRentalStation(String rentalStation) { this.rentalStation = rentalStation; } } Our well-known class Car is now extended by RentalCar with the additional property rentalStation. If an instance of RentalCar is validated, not only the @NotNull constraint on rentalStation is validated, but also the constraint on manufacturer from the parent class. The same would hold true, if Car were an interface implemented by RentalCar. Constraint annotations are aggregated if methods are overridden. If RentalCar would override the getManufacturer() method from Car any constraints annotated at the overriding method would be evaluated in addition to the @NotNull constraint from the super-class.