I have an interface CPUStore that has the following function
List<ICPU> getAllCPUs();
CPURepository implements CPUStore, and CPUEntity implements ICPU
When I try to do this, I'm getting an error since List<CPUEntity>
isn't the same as List<ICPU>
@Override
public List<CPUEntity> getAllCPUs() {
CriteriaBuilder builder = session.getCriteriaBuilder();
CriteriaQuery<CPUEntity> criteria = builder.createQuery(CPUEntity.class);
criteria.from(CPUEntity.class);
List<CPUEntity> data = session.createQuery(criteria).getResultList();
return data;
}
I should have the code compiling but it's not