I was thinking of a Validator like the Ajax one. See this example:TextField email = new TextField("email"); email.add(new JPAValidator()); // or new JPAValidator(Pojo.class);
Yep. Preferably without the class argument if possible.
And the class scans the Model for annotated properties and adds the related Wicket validators automatically. If the Model is a POJO not annotated with @Entity, its possible to use JPAValidator(Class clazz);.
Do we even need to scan for Entity? We only have to look for the properties, right? Also, I don't think we have to add extra validators. That one validator should be smart enough to configure itself for the class it is supposed to work on. I think it should do that lazily, and cache the results (e.g. as application scoped meta data per class).
What you guys think about this? (I like to see the code I'd like to use and implement it around the examples... :D )
Nothing beats a prototype though :) How about if you or anyone else interested in this makes a patch against phonebook as a proof of concept? Eelco
