1
我不明白什麼可以不對以下JPQL
查詢:JPQL查詢IS NOT NULL
StringBuilder sb = new StringBuilder("FROM FaPrimaryDocument AS t WHERE (t.debitAccount.id = :id or t.creditAccount.id = :id) " +
"AND t.debitAccount IS NOT NULL AND t.creditAccount IS NOT NULL ");
Query q = em.createQuery(sb.toString(), FaPrimaryDocument.class)
.setParameter("id", id);
List<FaPrimaryDocument> transactions = q.getResultList();
上面的查詢返回與debitAccount/creditAccount = null
行。我如何改變它,以便不返回行debitAccount/creditAccount = null
它看起來像查詢是正確的。 – Milkmaid
等一下。我將發佈輸出 – Sher
@Milkmaid,發佈更新 – Sher