My application is a store selling fishes, aquariums etc. I want to get a list of top 10 items among all the items based on sales count. I use the following class:
@MappedSuperclass
@NamedQueries({
@NamedQuery(name="getTopItems",query="SELECT x FROM FishStoreItem x ORDER BY x.salescnt DESC, x.title DESC")
})
public abstract class FishStoreItem
extends DomainSuperClass implements Serializable {
......
}
Problem is in the following exception:
Exception [EclipseLink-8034] (Eclipse Persistence Services - 2.0.0.v20091127-r5931): org.eclipse.persistence.exceptions.JPQLException Exception Description: Error compiling the query [getTopItems: SELECT x FROM FishStoreItem x ORDER BY x.salescnt DESC, x.title DESC]. Unknown entity type [FishStoreItem].
Same code works fine with Apache OpenJpa 2.0.0, but fails with EclipseLink ver 2.1.0, 2.0.1, 1.0.
P.S. I've already found that solution for Hibernate, but I want to be sure that it is impossible for EclipseLink too.