public class MapperUtil<T> { @Autowired protected Mapper<T> mapper; private Class<T> modelClass; public MapperUtil() { //this.modelClass = modelClass; //this.mapper=mapper; }
這個類在運行期會出現泛型擦除的狀況。 app
參考:http://www.iteye.com/problems/88739this