My GenericDao has:
public T get(K id);
Now my GenericDaoImpl has:
public T get(K id) {
return super.getHibernateTemplate().get(???, id);
}
I tried:
get(T.class, id);
But I get a compile time error:
cannot select from a type variable
Is it possible to do this correctly somehow?
Due to type erasure, that is not possible.
You need to take a
Classinstance as a parameter.