here's my code:
AbstractClass
public abstract class AbstractClass<T>{
public abstract Class<?> getPersistentClass();
public void invokeNothing(){
Class<T> c = getPersistentClass();
// do something....
// some code...
}
}
CommonClass
public class CommonClass<T> extends AbstractClass<T>{
public Class<?> getPersistentClass(){
// how to get the persistent class of generic T
// T.class
return // T.class
}
}
Service
public class CommonService{
@Autowired
private CommonAbstractClass<Person> commonClass;
public void invoke(){
commonClass.invokeNothing();
}
}
how to get the persistent class parameter of a class generic? in my class CommonClass in method getPersistentClass();
please help me thanks...