public class BaseDaoImpl<T> implements BaseDao<T>{
private Class<T> clazz=null;
public BaseDaoImpl() {
ParameterizedType pt=(ParameterizedType) getClass().getGenericSuperclass();
clazz=(Class<T>) pt.getActualTypeArguments()[0];//得到泛型的class
}
private Class<T> clazz=null;
public BaseDaoImpl() {
ParameterizedType pt=(ParameterizedType) getClass().getGenericSuperclass();
clazz=(Class<T>) pt.getActualTypeArguments()[0];//得到泛型的class
}