On Tue, 23 Jun 2009 22:32:25 +0200, nille hammer 
<tapestry.nilleham...@winfonet.eu> wrote:

> That's the trick! Thinking about your hint I rewrote GenericEntityPage<T> a 
> bit. Code follows:
>
>       /**
>        * @return the page to be forwarded to in case value does not exist as 
> SSO
>        */
>       protected abstract Object getForwardPage();
>
>       /**
>        * @return the value's class in the implementing page
>        */
>       protected abstract Class<T> getValueClass();



Actually, getValueClass() doesn't have to be abstract. It can look like this:


protected Class<T> getValueClass()
{
        return (Class<T>) ((ParameterizedType) 
getClass().getGenericSuperclass()).getActualTypeArguments()[0];
}


I use something similar in DAOs, idea came from here:
https://www.hibernate.org/328.html

Martin

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

Reply via email to