使用反射获取类型参数的真实类型

public DaoBaseImpl () {

       Type type = this.getClass().getGenericSuperclass();

       ParameterizedType pt = (ParameterizedType) type;

       this.clazz = (Class<T>) pt.getActualTypeArguments()[0];

    }

原文地址:https://www.cnblogs.com/sallet/p/3926400.html