【发布时间】:2020-05-14 05:35:05
【问题描述】:
在不工作的 JPA 之间。
模态类:
public class Record extends AbstractTimestampEntity{
string id;
string senderId;
string reciverId;
string status;
@Column(name = "txn_Date", columnDefinition = "DATE")
Date txnDate;
}
JPA 查询:
findByTxnDateBetweenAndSenderIdOrReciverIdAndStatus(Date from,Date to,String serderId,String reciverId,String status);
即使我从和到日期发送过滤器也没有在查询中应用。
我在mysql查询中尝试过同样的查询
select * from record where txn_date between "2020-01-09" and "2020-05-09" and sender_id = "98bd543e-942d-4725-b9bc-32c99eb089ae" or reciver_id = "98bd543e-942d-4725-b9bc-32c99eb089ae" and status = "COMPLETED";
在这里我得到了预期的结果。但是在 JPA 中没有得到
【问题讨论】:
-
您能描述一下您的
And-Orsql 查询条件吗? -
您遇到的错误是什么?
-
我没有看到任何错误。
标签: java hibernate spring-boot jpa spring-data-jpa