We have close to a hundred repositories, this wouldn't work. How do you
inject the services into the EntityModel anyway?

On Thu, 2009-11-12 at 08:34 +0100, Matthias Keller wrote:
> Hi Sam
> 
> What exactly do you mean by repository? Do you have to load every entity 
> from another place?
> in load(), we have the code to load every possible entity in our 
> implementation, for example:
> 
> T entity;
> if (this.clazz == User.class) {
>     entity = userService.load(...);
> } else if (this.clazz == Company.class) {
>     entity = companyService.load(...);
> } else .....
> 
> And so on. In the end, the entity is loaded from wherever it is defined 
> for this class...
> 
> Matt
> 
> Sam Barrow wrote:
> > Does anybody how to pass a smart EntityModel (link below) to another
> > page? We use a different repository for each entity type. I can't get it
> > to work. I have tried storing the repository as a field on the
> > EntityModel and using an abstract method on EntityModel to retrieve it.
> >
> > http://wicketinaction.com/2008/09/building-a-smart-entitymodel/
> >   
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to