Package javax.validation.constraints

Examples of javax.validation.constraints.NotNull.groups()


    Set<ConstraintViolation<FrenchAddress>> constraintViolations = validator.validate( address );
    assertCorrectNumberOfViolations( constraintViolations, 1 );
    ConstraintViolation<FrenchAddress> constraintViolation = constraintViolations.iterator().next();
    assertCorrectConstraintTypes( constraintViolations, NotNull.class );
    NotNull notNull = (NotNull) constraintViolation.getConstraintDescriptor().getAnnotation();
    List<Class<?>> groups = Arrays.asList( notNull.groups() );
    assertTrue( groups.size() == 2, "There should be two groups" );
    assertTrue( groups.contains( Default.class ), "The default group should be in the list." );
    assertTrue(
        groups.contains( FrenchAddress.FullAddressCheck.class ),
        "The FrenchAddress.FullAddressCheck group should be inherited."
View Full Code Here


      generatedPropFactory.setUpdateTimestamp(prop);
    }

    if (validationAnnotations) {
      NotNull notNull = get(prop, NotNull.class);
      if (notNull != null && isNotNullOnAllValidationGroups(notNull.groups())) {
        // Not null on all validation groups so enable
        // DDL generation of Not Null Constraint
        prop.setNullable(false);
      }
View Full Code Here

    Set<ConstraintViolation<FrenchAddress>> constraintViolations = validator.validate( address );
    assertCorrectNumberOfViolations( constraintViolations, 1 );
    ConstraintViolation<FrenchAddress> constraintViolation = constraintViolations.iterator().next();
    assertCorrectConstraintTypes( constraintViolations, NotNull.class );
    NotNull notNull = (NotNull) constraintViolation.getConstraintDescriptor().getAnnotation();
    List<Class<?>> groups = Arrays.asList( notNull.groups() );
    assertTrue( groups.size() == 2, "There should be two groups" );
    assertTrue( groups.contains( Default.class ), "The default group should be in the list." );
    assertTrue(
        groups.contains( FrenchAddress.FullAddressCheck.class ),
        "The FrenchAddress.FullAddressCheck group should be inherited."
View Full Code Here

    Set<ConstraintViolation<FrenchAddress>> constraintViolations = validator.validate( address );
    assertCorrectNumberOfViolations( constraintViolations, 1 );
    ConstraintViolation<FrenchAddress> constraintViolation = constraintViolations.iterator().next();
    assertCorrectConstraintTypes( constraintViolations, NotNull.class );
    NotNull notNull = ( NotNull ) constraintViolation.getConstraintDescriptor().getAnnotation();
    List<Class<?>> groups = Arrays.asList( notNull.groups() );
    assertTrue( groups.size() == 2, "There should be two groups" );
    assertTrue( groups.contains( Default.class ), "The default group should be in the list." );
    assertTrue(
        groups.contains( FrenchAddress.FullAddressCheck.class ),
        "The FrenchAddress.FullAddressCheck group should be inherited."
View Full Code Here

    Set<ConstraintViolation<FrenchAddress>> constraintViolations = validator.validate( address );
    assertCorrectNumberOfViolations( constraintViolations, 1 );
    ConstraintViolation<FrenchAddress> constraintViolation = constraintViolations.iterator().next();
    assertCorrectConstraintTypes( constraintViolations, NotNull.class );
    NotNull notNull = ( NotNull ) constraintViolation.getConstraintDescriptor().getAnnotation();
    List<Class<?>> groups = Arrays.asList( notNull.groups() );
    assertTrue( groups.size() == 2, "There should be two groups" );
    assertTrue( groups.contains( Default.class ), "The default group should be in the list." );
    assertTrue(
        groups.contains( FrenchAddress.FullAddressCheck.class ),
        "The FrenchAddress.FullAddressCheck group should be inherited."
View Full Code Here

    Set<ConstraintViolation<FrenchAddress>> constraintViolations = validator.validate( address );
    assertCorrectNumberOfViolations( constraintViolations, 1 );
    ConstraintViolation<FrenchAddress> constraintViolation = constraintViolations.iterator().next();
    assertCorrectConstraintTypes( constraintViolations, NotNull.class );
    NotNull notNull = ( NotNull ) constraintViolation.getConstraintDescriptor().getAnnotation();
    List<Class<?>> groups = Arrays.asList( notNull.groups() );
    assertTrue( groups.size() == 2, "There should be two groups" );
    assertTrue( groups.contains( Default.class ), "The default group should be in the list." );
    assertTrue(
        groups.contains( FrenchAddress.FullAddressCheck.class ),
        "The FrenchAddress.FullAddressCheck group should be inherited."
View Full Code Here

    Set<ConstraintViolation<FrenchAddress>> constraintViolations = validator.validate( address );
    assertCorrectNumberOfViolations( constraintViolations, 1 );
    ConstraintViolation<FrenchAddress> constraintViolation = constraintViolations.iterator().next();
    assertCorrectConstraintTypes( constraintViolations, NotNull.class );
    NotNull notNull = ( NotNull ) constraintViolation.getConstraintDescriptor().getAnnotation();
    List<Class<?>> groups = Arrays.asList( notNull.groups() );
    assertTrue( groups.size() == 2, "There should be two groups" );
    assertTrue( groups.contains( Default.class ), "The default group should be in the list." );
    assertTrue(
        groups.contains( FrenchAddress.FullAddressCheck.class ),
        "The FrenchAddress.FullAddressCheck group should be inherited."
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.