Does your Person class implements the 'Identifiable' interface?

On Mon, Apr 18, 2011 at 4:27 AM, lucast [via Apache Wicket] <
ml-node+3456789-549093517-65...@n4.nabble.com> wrote:

> Hi Clint,
> Here is the example of EntityModel as taken from
> http://wicketinaction.com/2008/09/building-a-smart-entitymodel/.
> I've added the constructor that calls super().
> public class EntityModel<T> extends AbstractEntityModel<T> {
>         public EntityModel(Class<? extends T> clazz, Serializable id) {
>                 super(clazz, id);
>         }
>         @Override
>         protected T load(Class clazz, Serializable id) {
>                 return WicketApplication.get().get_service().load(clazz,
> id);
>         }
> }
> Now my I have two errors from my IDE (Eclipse), the first one on *extends
> AbstractEntityModel<T> {*. On type T, it says: Bound mismatch: The type T
> is not a valid substitute for the bounded parameter <T extends
> Identifiable<?>> of the type AbstractEntityModel<T>.
> Would you know what is going on here? I am following the exact example.
>
> The second error my IDE is complaining about is on *return
> WicketApplication.get().get_service().load(clazz, id);*: The method
> load(Class<T>, long) in the type Service is not applicable for the arguments
> (Class, Serializable).
> That's fair enough since all the objects ID i'm persisting to DB are of
> type Long.
> But why is the example using type Serializable instead of Long?
> If you look at the section "Using EntityModel to bind to Forms", from the
> link above you will see that the values passed are class and Long:
>  public EditPersonPage(Long personId)
>     {
>         this(new EntityModel<Person>(Person.class, personId));
>     }
>
> I fear I'm missing a very small detail that's stopping me from having this
> working.
> Thanks, Lucas
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-wicket.1842946.n4.nabble.com/Refreshing-loadable-detachable-model-object-inside-an-ajax-call-tp3446979p3456789.html
>  To start a new topic under Apache Wicket, email
> ml-node+1842946-398011874-65...@n4.nabble.com
> To unsubscribe from Apache Wicket, click 
> here<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1842946&code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=>.
>
>



-- 

JC


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Refreshing-loadable-detachable-model-object-inside-an-ajax-call-tp3446979p3457165.html
Sent from the Users forum mailing list archive at Nabble.com.

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

Reply via email to