Yep. Preferably without the class argument if possible.
It must have a constructor with class argument (or even with an array/list
of classes?), because not always users are going to use the @Entity as
Model, just a simple (maybe inner) pojo. And the annotations can be there.
Of course it must support annotations in the Pojo itself, as H.V. is an
independent framework (doesn't need to have annotations at the persistence
level).
[]'s
--
Bruno Borges
Summa Technologies Inc.
www.summa-tech.com
(48) 8404-1300
(11) 3055-2060
On 4/25/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> 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