All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hibernate.beanvalidation.tck.tests.xmlconfiguration.user-constraints-MultipleBeanDefinitionTest.xml Maven / Gradle / Ivy

There is a newer version: 3.0.1
Show newest version
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Jakarta Bean Validation TCK

    License: Apache License, Version 2.0
    See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.

-->
<constraint-mappings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:schemaLocation="https://xmlns.jakarta.ee/xml/ns/validation/mapping validation-mapping-3.0.xsd"
                     xmlns="https://xmlns.jakarta.ee/xml/ns/validation/mapping"
                     version="3.0">
    <default-package>org.hibernate.beanvalidation.tck.tests.xmlconfiguration</default-package>
    <bean class="User" ignore-annotations="false">
        <class ignore-annotations="true">
            <group-sequence>
                <value>User</value>
                <value>Optional</value>
            </group-sequence>
            <constraint annotation="org.hibernate.beanvalidation.tck.tests.xmlconfiguration.ConsistentUserInformation">
                <message>Message from xml</message>
                <groups>
                    <value>jakarta.validation.groups.Default</value>
                </groups>
                <element name="stringParam">foobar</element>
                <element name="stringArrayParam">
                    <value>foo</value>
                    <value>bar</value>
                </element>
                <element name="intParam">
                    <value>42</value>
                </element>
                <element name="patterns">
                    <annotation>
                        <element name="regexp">myRegExp1</element>
                    </annotation>
                    <annotation>
                        <element name="regexp">myRegExp2</element>
                    </annotation>
                </element>
                <element name="userType">SELLER</element>
            </constraint>
        </class>
        <field name="lastname">
            <constraint annotation="jakarta.validation.constraints.Pattern">
                <message>Last name has to start with with a capital letter.</message>
                <element name="regexp">^[A-Z][a-z]+</element>
            </constraint>
        </field>
        <field name="creditcard">
            <valid/>
        </field>
        <getter name="firstname" ignore-annotations="true">
            <constraint annotation="jakarta.validation.constraints.Size">
                <message>Size is limited!</message>
                <groups>
                    <value>org.hibernate.beanvalidation.tck.tests.xmlconfiguration.TestGroup</value>
                    <value>jakarta.validation.groups.Default</value>
                </groups>
                <element name="max">10</element>
            </constraint>
        </getter>
    </bean>
    <constraint-definition annotation="org.hibernate.beanvalidation.tck.tests.xmlconfiguration.ConsistentUserInformation">
        <validated-by include-existing-validators="false">
            <value>org.hibernate.beanvalidation.tck.tests.xmlconfiguration.CustomConsistentUserValidator</value>
        </validated-by>
    </constraint-definition>
</constraint-mappings>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy