private static void applyDigits(Property property, ConstraintDescriptor<?> descriptor) { if ( Digits.class.equals( descriptor.getAnnotation().annotationType() ) ) { @SuppressWarnings("unchecked") ConstraintDescriptor<Digits> digitsConstraint = (ConstraintDescriptor<Digits>) descriptor; int integerDigits = digitsConstraint.getAnnotation().integer(); int fractionalDigits = digitsConstraint.getAnnotation().fraction(); @SuppressWarnings("unchecked") final Iterator<Selectable> itor = property.getColumnIterator(); if ( itor.hasNext() ) { final Selectable selectable = itor.next(); if ( Column.class.isInstance( selectable ) ) { Column col = (Column) selectable; col.setPrecision( integerDigits + fractionalDigits ); col.setScale( fractionalDigits ); } } } }
@Override public final void initialize(Digits constraintAnnotation) { if (!(constraintAnnotation.fraction() >= 0)) { throw new IllegalArgumentException( "@Digits.fraction must be a nonnegative nubmer"); } if (!(constraintAnnotation.integer() >= 0)) { throw new IllegalArgumentException( "@Digits.integer must be a nonnegative nubmer"); } fraction = constraintAnnotation.fraction(); integer = constraintAnnotation.integer(); }
private static void applyDigits(Property property, ConstraintDescriptor<?> descriptor) { if ( Digits.class.equals( descriptor.getAnnotation().annotationType() ) ) { @SuppressWarnings( "unchecked" ) ConstraintDescriptor<Digits> digitsConstraint = (ConstraintDescriptor<Digits>) descriptor; int integerDigits = digitsConstraint.getAnnotation().integer(); int fractionalDigits = digitsConstraint.getAnnotation().fraction(); Column col = (Column) property.getColumnIterator().next(); col.setPrecision( integerDigits + fractionalDigits ); col.setScale( fractionalDigits ); } }
@Override public void initialize(Digits annotation) { this.integral = annotation.integer(); this.fractional = annotation.fraction(); if (integral < 0) { throw new IllegalArgumentException("The length of the integer part cannot be negative."); } if (fractional < 0) { throw new IllegalArgumentException("The length of the fraction part cannot be negative."); } }
@Override public void initialize(Digits constraintAnnotation) { this.fraction = constraintAnnotation.fraction(); this.integer = constraintAnnotation.integer(); }
@Override public void initialize(Digits annotation) { this.integral = annotation.integer(); this.fractional = annotation.fraction(); if (integral < 0) { throw new IllegalArgumentException("The length of the integer part cannot be negative."); } if (fractional < 0) { throw new IllegalArgumentException("The length of the fraction part cannot be negative."); } }
@Override public void initialize(Digits annotation) { this.integral = annotation.integer(); this.fractional = annotation.fraction(); if (integral < 0) { throw new IllegalArgumentException("The length of the integer part cannot be negative."); } if (fractional < 0) { throw new IllegalArgumentException("The length of the fraction part cannot be negative."); } }
public void initialize(Digits annotation) { this.integral = annotation.integer(); this.fractional = annotation.fraction(); if (integral < 0) { throw new IllegalArgumentException( "The length of the integer part cannot be negative."); } if (fractional < 0) { throw new IllegalArgumentException( "The length of the fraction part cannot be negative."); } }
public void initialize(Digits annotation) { this.integral = annotation.integer(); this.fractional = annotation.fraction(); if (integral < 0) { throw new IllegalArgumentException( "The length of the integer part cannot be negative."); } if (fractional < 0) { throw new IllegalArgumentException( "The length of the fraction part cannot be negative."); } }
@Override public void initialize(Digits annotation) { this.integral = annotation.integer(); this.fractional = annotation.fraction(); if (integral < 0) { throw new IllegalArgumentException("The length of the integer part cannot be negative."); } if (fractional < 0) { throw new IllegalArgumentException("The length of the fraction part cannot be negative."); } }
@Override public final void initialize(Digits constraintAnnotation) { if (!(constraintAnnotation.fraction() >= 0)) { throw new IllegalArgumentException( "@Digits.fraction must be a nonnegative nubmer"); } if (!(constraintAnnotation.integer() >= 0)) { throw new IllegalArgumentException( "@Digits.integer must be a nonnegative nubmer"); } fraction = constraintAnnotation.fraction(); integer = constraintAnnotation.integer(); }
@Override public final void initialize(Digits constraintAnnotation) { if (!(constraintAnnotation.fraction() >= 0)) { throw new IllegalArgumentException( "@Digits.fraction must be a nonnegative nubmer"); } if (!(constraintAnnotation.integer() >= 0)) { throw new IllegalArgumentException( "@Digits.integer must be a nonnegative nubmer"); } fraction = constraintAnnotation.fraction(); integer = constraintAnnotation.integer(); }
@Override public void initialize(Digits constraintAnnotation) { this.maxIntegerLength = constraintAnnotation.integer(); this.maxFractionLength = constraintAnnotation.fraction(); validateParameters(); }
@Override public void initialize(Digits constraintAnnotation) { this.maxIntegerLength = constraintAnnotation.integer(); this.maxFractionLength = constraintAnnotation.fraction(); validateParameters(); }
@Override public void initialize(Digits constraintAnnotation) { this.maxIntegerLength = constraintAnnotation.integer(); this.maxFractionLength = constraintAnnotation.fraction(); validateParameters(); }
@Override public void initialize(Digits constraintAnnotation) { this.maxIntegerLength = constraintAnnotation.integer(); this.maxFractionLength = constraintAnnotation.fraction(); validateParameters(); }
@Override public void initialize(final Digits digitsAnnotation) { this.maxIntegerLength = digitsAnnotation.integer(); this.maxFractionLength = digitsAnnotation.fraction(); validateParameters(); }
private static void applyDigits(Property property, ConstraintDescriptor<?> descriptor) { if ( Digits.class.equals( descriptor.getAnnotation().annotationType() ) ) { @SuppressWarnings("unchecked") ConstraintDescriptor<Digits> digitsConstraint = (ConstraintDescriptor<Digits>) descriptor; int integerDigits = digitsConstraint.getAnnotation().integer(); int fractionalDigits = digitsConstraint.getAnnotation().fraction(); Column col = (Column) property.getColumnIterator().next(); col.setPrecision( integerDigits + fractionalDigits ); col.setScale( fractionalDigits ); } }
private static void applyDigits(Property property, ConstraintDescriptor<?> descriptor) { if ( Digits.class.equals( descriptor.getAnnotation().annotationType() ) ) { @SuppressWarnings("unchecked") ConstraintDescriptor<Digits> digitsConstraint = (ConstraintDescriptor<Digits>) descriptor; int integerDigits = digitsConstraint.getAnnotation().integer(); int fractionalDigits = digitsConstraint.getAnnotation().fraction(); Column col = (Column) property.getColumnIterator().next(); col.setPrecision( integerDigits + fractionalDigits ); col.setScale( fractionalDigits ); } }
private static void applyDigits(PersistentAttributeMapping property, ConstraintDescriptor<?> descriptor) { if ( Digits.class.equals( descriptor.getAnnotation().annotationType() ) ) { @SuppressWarnings("unchecked") final ConstraintDescriptor<Digits> digitsConstraint = (ConstraintDescriptor<Digits>) descriptor; final int integerDigits = digitsConstraint.getAnnotation().integer(); final int fractionalDigits = digitsConstraint.getAnnotation().fraction(); final Column col = getColumn( property ); col.setPrecision( integerDigits + fractionalDigits ); col.setScale( fractionalDigits ); } }