N
nr
Hi,
I'm new to java's template/generic programming.
I'm using JPA and e.g. the find method of EntityManager:
// regular
Entity ent = em.find (Entity.class, key)
How can I make this when using find inside a template/generic ?
How to get the ".class" work ?
class Access<T>
{
public T findIt (int key)
{
// T.class does not work
return em.find (T.class, key) ;
}
}
Thanx a lot for help
NR
I'm new to java's template/generic programming.
I'm using JPA and e.g. the find method of EntityManager:
// regular
Entity ent = em.find (Entity.class, key)
How can I make this when using find inside a template/generic ?
How to get the ".class" work ?
class Access<T>
{
public T findIt (int key)
{
// T.class does not work
return em.find (T.class, key) ;
}
}
Thanx a lot for help
NR