package jnpf.base.controller; import jnpf.base.service.SuperService; import org.springframework.beans.factory.annotation.Autowired; import java.lang.reflect.ParameterizedType; public abstract class SuperController, Entity> { @Autowired protected S baseService; Class entityClass = null; public Class getEntityClass() { if (entityClass == null) { this.entityClass = (Class) ((ParameterizedType) this.getClass().getGenericSuperclass()).getActualTypeArguments()[1]; } return this.entityClass; } public S getBaseService() { return baseService; } }