I'm not sure if this is the correct place to post RI related issues, but I'm taking CR3 for a spin and found that constraints applied to a superclass via XML are not being validated. For example:
Code:
<constraint-mappings
xmlns="http://jboss.org/xml/ns/javax/validation/mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://jboss.org/xml/ns/javax/validation/mapping validation-mapping-1.0.xsd">
<default-package>bv</default-package>
<bean class="Super" ignore-annotations="false">
<getter name="superStrValue">
<valid/>
<constraint annotation="javax.validation.constraints.NotNull"/>
</getter>
</bean>
<bean class="Base" ignore-annotations="false">
<getter name="strValue">
<valid/>
<constraint annotation="javax.validation.constraints.NotNull"/>
</getter>
</bean>
</constraint-mappings>
With bean classes:
Code:
package bv;
public class Base extends Super {
private int id;
private String strValue;
public void setId(int id) {
this.id = id;
}
public int getId() {
return id;
}
public void setStrValue(String strValue) {
this.strValue = strValue;
}
public String getStrValue() {
return strValue;
}
}
Code:
package bv;
//import javax.validation.constraints.NotNull;
public class Super {
private String superStrValue;
public void setSuperStrValue(String superStrValue) {
this.superStrValue = superStrValue;
}
// @NotNull
public String getSuperStrValue() {
return superStrValue;
}
}
When validating the Base class with null strValue and superStrValue, a CV is only returned for strValue. Validating an instance of Super directly does return a CV for superStrValue, so my constraint is defined properly in XML. I do get both CV's if I specify the constraint in the superclass via annotation (as commented out in the code above).
-Jeremy