-
1. Re: manual validation based on hibernate validation
marx3 Feb 20, 2008 2:32 PM (in response to marx3)Accordingly to
hibernate documentation
i know how to launch validatoin from Java code. Hovewer to use it I have to somewhat translate model annotation to validator classes.
Is it possible to automate it, or I have to do that manually? -
2. Re: manual validation based on hibernate validation
nickarls Feb 20, 2008 3:12 PM (in response to marx3)I think I've always iterated through the InvalidValue[] myself.
-
3. Re: manual validation based on hibernate validation
marx3 Feb 20, 2008 3:15 PM (in response to marx3)I don't understand.
I have MyBean class with @Email annotation on:
public class MyBean { @Email public String email; }
in my model.
I also have an instance of myBean.
Now i want to simulate s:validateAll on myBean, so I need to launch hibernate validation of email.
I need to use reflection to read annotation from field, translate somehow this annotation to validator class, and then launch validator as described in hibernate validator documentation.How can I do that simpler?
-
4. Re: manual validation based on hibernate validation
marx3 Feb 21, 2008 8:00 AM (in response to marx3)any help?
-
5. Re: manual validation based on hibernate validation
nickarls Feb 21, 2008 8:07 AM (in response to marx3)ClassValidator v = new ClassValidator(MyBean.class); InvalidValue[] iv = v.getInvalidValues(mybeaninstance); for (v : iv) { // process the InvalidValue }
-
6. Re: manual validation based on hibernate validation
marx3 Feb 21, 2008 8:13 AM (in response to marx3)Thank you, I see I didn't understand hibernate documentaion properly. Now it's clear!