GenericTypes

dla: public abstract class BaseService<DTO extends GenericDto<T>, T extends BaseEntity>

rozwiązanie 1:

public BaseService(Class<DTO> dtoClass, Class<T> jpaClass) {
super();
this.dtoClass = dtoClass;
this.jpaClass = jpaClass;
}

rozwiązanie 2:

(Class<DTO>)((ParameterizedType)superclass).getActualTypeArguments()[0];

(Class<T>)((ParameterizedType)superclass).getActualTypeArguments()[1];

Reklamy