1

I have the following class structure:

class TransactionRelation{
      Transaction req;
      Transaction resp;
      ....
}

class Transaction{
    Long id;
    private Set<TransactionStateHistory> transactionStateHistory;
    ...
} 

public class TransactionStateHistory {
    private Long id;    
    private TransactionState transactionState;
}

I need to query transactions who is req from TransactionRelation, each transaction from result should has TransactionStateHistory with type type1

and corresponding response transaction should not have TransactionStateHistorywith typetype2`

How does JPQL suggest to resolve the following task?

This topic goes around my topic but my a bit more complicated

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

I need to write something like this:

SELECT d FROM Document AS d WHERE: user MEMBER OF d.accessors.attribute
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
  • I think you probably want an `EXIST` expression with a subquery. However, the description of your requirement is a little convoluted. Could you perhaps provide an example? Alternatively, you could provide an equivalent SQL query for translation – crizzis May 22 '17 at 13:29

0 Answers0