This topic has not yet been written. The content below is from the topic description.
4.2. Mapping constraints Expressing constraints in XML is possible via files adhering to the xsd seen in Example 4.3, “validation-mapping-1.0.xsd”. Note that these mapping files are only processed if listed via constraint-mapping in your validation.xml. Example 4.3. validation-mapping-1.0.xsd Example 4.4, “constraints-car.xml” shows how our classes Car and RentalCar from Example 2.15, “Car” resp. Example 2.19, “RentalCar” could be mapped in XML. Example 4.4. constraints-car.xml org.hibernate.validator.quickstart 2 The car has to pass the vehicle inspection first CarChecks 10 RentalCar CarChecks org.mycompany.CheckCaseValidator The XML configuration is closely mirroring the programmatic API. For this reason it should suffice to just add some comments. default-package is used for all fields where a classname is expected. If the specified class is not fully qualified the configured default package will be used. Every mapping file can then have several bean nodes, each describing the constraints on the entity with the specified class name. Warning A given entity can only be configured once across all configuration files. If the same class is configured more than once an exception is thrown. Settings ignore-annotations to true means that constraint annotations placed on the configured bean are ignored. The default for this value is true. ignore-annotations is also available for the nodes class, fields and getter. If not explicitly specified on these levels the configured bean value applies. Otherwise do the nodes class, fields and getter determine on which level the constraints are placed (see Section 2.1, “Defining constraints”). The constraint node is then used to add a constraint on the corresponding level. Each constraint definition must define the class via the annotation attribute. The constraint attributes required by the Bean Validation specification (message, groups and payload) have dedicated nodes. All other constraint specific attributes are configured using the the element node. The class node also allows to reconfigure the default group sequence (see Section 2.3.2, “Redefining the default group sequence of a class”) via the group-sequence node. Last but not least, the list of ConstraintValidators associated to a given constraint can be altered via the constraint-definition node. The annotation attribute represents the constraint annotation being altered. The validated-by elements represent the (ordered) list of ConstraintValidator implementations associated to the constraint. If include-existing-validator is set to false, validators defined on the constraint annotation are ignored. If set to true, the list of ConstraintValidators described in XML are concatenated to the list of validators described on the annotation.