How can I achieve this?
public class GenericClass { public Type getMyType() { //How do I return the type of T? } }
I have seen something like this
private Class persistentClass; public Constructor() { this.persistentClass = (Class) ((ParameterizedType) getClass() .getGenericSuperclass()).getActualTypeArguments()[0]; }
in the hibernate GenericDataAccessObjects Example