标签:
public abstract class BaseDaoImpl<T> implements BaseDao<T> {
private Class<T> clazz;
public List<T> findAll() {
return getSession().createQuery(//
"FROM " + clazz.getSimpleName())//
.list();
}
}
获取当前泛型类的传入,BaseDaoImpl<T> implements BaseDao<T>
标签:
原文地址:http://www.cnblogs.com/qiyc/p/5828003.html