Package org.hibernate.validator

Examples of org.hibernate.validator.HibernateValidatorConfiguration.addMapping()


    mapping.type( OrderLine.class )
        .method( "getId" )
          .returnValue()
            .unwrapValidatedValue( true );

    Validator validator = configuration.addMapping( mapping )
        .addValidatedValueHandler( new PropertyValueUnwrapper() )
        .buildValidatorFactory()
        .getValidator();

    OrderLine orderLine = new OrderLine();
View Full Code Here


                .ignoreNonDigitCharacters( true )
                .treatCheck10As( 'X' )
                .treatCheck11As( 'P' )
                .processingDirection( ProcessingDirection.LEFT_TO_RIGHT )
        );
    config.addMapping( mapping );
    Validator validator = config.buildValidatorFactory().getValidator();

    Product product = new Product( "123-456-789-P" );

    Set<ConstraintViolation<Product>> constraintViolations = validator.validate( product );
View Full Code Here

          .constraint( new SizeDef().min( 2 ).max( 14 ) )
      .type( RentalCar.class )
        .property( "rentalStation", METHOD )
          .constraint( new NotNullDef() );

    Validator validator = configuration.addMapping( constraintMapping )
        .buildValidatorFactory()
        .getValidator();
  }

  @Test
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.