PA JPQL:检查所有收集项目是否具有预定义值

时间:2017-05-22 12:46:38

标签: java sql jpa hql jpql

我有以下类结构:

class TransactionRelation{
      Transaction req;
      Transaction resp;
      ....
}
class Transaction{
    Long id;
    private Set<TransactionStateHistory> transactionStateHistory;
    ...
} 
public class TransactionStateHistory {
    private Long id;    
    private TransactionState transactionState;
}

我需要从req查询TransactionRelation的交易, 结果中的每个交易都应为TransactionStateHistory,类型为type1

和相应的响应事务不应该具有TransactionStateHistory with type type2`

JPQL如何建议解决以下任务?

本主题围绕我的主题,但我有点复杂

JPA JPQL: select items when attribute of item (list/set) contains another item

我需要写这样的东西:

SELECT d FROM Document AS d WHERE: user MEMBER OF d.accessors.attribute

0 个答案:

没有答案