[
http://opensource.atlassian.com/projects/hibernate/browse/HV-444?page=com...
]
Kevin Pollet updated HV-444:
----------------------------
Description:
If constraints and default group sequence are defined with the programmatic API, the
following code doesn't work (no validation error).
{code}
class A {
String a;
}
class B extends A {
}
public interface Foo {
}
ConstraintMapping mapping = new ConstraintMapping();
mapping.type( B.class )
.defaultGroupSequence( Foo.class, B.class )
.type( A.class )
.property( "a", ElementType.FIELD )
.constraint( NotNullDef.class ).groups( Foo.class );
HibernateValidatorConfiguration config = Validation.byProvider( HibernateValidator.class
).configure();
ValidatorFactory factory = config.addMapping( mapping ).buildValidatorFactory();
Validator validator = factory.getValidator();
validator.validate( new B() );
{code}
was:
If constraints and default group sequence are defined with the programmatic API the
following code doesn't work (no validation error) .
{code}
class A {
String a;
}
class B extends A {
}
public interface Foo {
}
ConstraintMapping mapping = new ConstraintMapping();
mapping.type( B.class )
.defaultGroupSequence( Foo.class, B.class )
.type( A.class )
.property( "a", ElementType.FIELD )
.constraint( NotNullDef.class ).groups( Foo.class );
HibernateValidatorConfiguration config = Validation.byProvider( HibernateValidator.class
).configure();
ValidatorFactory factory = config.addMapping( mapping ).buildValidatorFactory();
Validator validator = factory.getValidator();
validator.validate( new B() );
{code}
Default group sequence defined with programmatic API is not used if
the configured class doesn't define programmatic constraints
--------------------------------------------------------------------------------------------------------------------------------
Key: HV-444
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HV-444
Project: Hibernate Validator
Issue Type: Bug
Components: engine
Affects Versions: 4.2.0.Beta1
Reporter: Kevin Pollet
Fix For: 4.2.0.Beta2
If constraints and default group sequence are defined with the programmatic API, the
following code doesn't work (no validation error).
{code}
class A {
String a;
}
class B extends A {
}
public interface Foo {
}
ConstraintMapping mapping = new ConstraintMapping();
mapping.type( B.class )
.defaultGroupSequence( Foo.class, B.class )
.type( A.class )
.property( "a", ElementType.FIELD )
.constraint( NotNullDef.class ).groups( Foo.class );
HibernateValidatorConfiguration config = Validation.byProvider( HibernateValidator.class
).configure();
ValidatorFactory factory = config.addMapping( mapping ).buildValidatorFactory();
Validator validator = factory.getValidator();
validator.validate( new B() );
{code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira