简体   繁体   English

JPA Repository 中的 DateGreaterThanEqual 和 DateIsGreaterThanEqual 有什么区别?

[英]What is the difference between DateGreaterThanEqual and DateIsGreaterThanEqual in JPA Repository?

I'm trying to get all the Reservations for a user with username that are after the current date or equal the current date我正在尝试获取用户名在当前日期之后或等于当前日期的用户的所有预订

Do I need to use:我需要使用:

List<Reservation> findReservationsByUsernameAndDateGreaterThanEqual(String username, Date date);

OR或者

List<Reservation> findReservationsByUsernameAndDateIsGreaterThanEqual(String username, Date date);

What is the difference between them?它们之间有什么区别?

The difference is literally the Is part.区别实际上是Is部分。 Functionally they are the same.在功能上它们是相同的。

You can find this information in https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repository-query-keywords您可以在https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repository-query-keywords中找到此信息

Or if you prefer the source code you should take a look at org.springframework.data.repository.query.parser.Part.Type或者,如果您更喜欢源代码,您应该看看 org.springframework.data.repository.query.parser.Part.Type

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM