Hi everybody,
First of all, I am sorry if my description sounds a bit dumb but I am very new to the field.
The structure of my problem looks like this:
I have two classes which I am using to generate my class objects, FormInfo and People. In FormInfo I create two objects of the class People, Manager and NonManager, which have different validation needs. For the Manager object fields all informations needs to be supplied, so all the fields (firstName, sureName and so on) need to be notBlank. But giving these infos on the NonManager object is optional therefore can be blank.
I have tried to use inner object constraints as follows
Code:
<bean class="FromInfo" ignore-annotations="false">
<field name="Manager">
<valid/>
</field>
</bean>
<bean class="Manager" ignore-annotations="false">
<field name="firstName">
<constraint annotation="org.hibernate.validator.constraints.NotBlank">
<message>{NotBlank}</message>
</constraint>
</field>
</bean>
so that the firstName of a Manager would be required but the a NonManager would not need to enter his/her name. But it always throughs a javax.validation.ValidationException: Unable to load class: Manager
I am pretty sure I am doing it wrong but I don't understand what I am doing wrong.
Any help is greatly appreciated!!!
Thanks a lot in advance and best regards!
norbert