I have the following entities:
@Entity
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="orderType", discriminatorType=DiscriminatorType.STRING)
@DiscriminatorValue(value="BASE")
@Table(name = "orders")
public class OrderEntity implements Serializable {
...
and
@Entity
@DiscriminatorValue(value="RECURRING")
public class RecurringOrderEntity extends OrderEntity{
...
I can find all the subclasses (RecurringOrderEntity) with the following jpql:
Query q = em.createQuery(
"SELECT o from RecurringOrderEntity o where "
+ "o.cancellationDate is null "
+ "and o.maxOccurrences = o.occurrence");
What is the JPQL syntax for finding only entities that are not instances of RecurringOrderEntity?
I am using Eclipselink 2.0.0 as the JPA provider.
thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…