【发布时间】:2018-03-29 02:48:14
【问题描述】:
@Query(value = "Select f from Documents f " +
"RIGHT JOIN f.documentStatus ds " +
"where f.billingAccount.accountId in :billingAccountIdList " +
" and ds.statusCode in :paymentStatuses" +
" and f.paymentDate < :paymentDate")
List<FinancialDocumentEntity> getFinancialDocumentsOverdue(@Param("billingAccountIdList")List<String> billingAccountIdList,
@Param("paymentStatuses") List<String> paymentStatuses,
@Param("paymentDate") Date paymentDate);
我有类似上面的查询。如果为 null 或为空,是否可以在查询方法中跳过搜索参数,例如 @Param("paymentStatuses")?
【问题讨论】:
标签: java spring hibernate spring-data-jpa jpql