简体   繁体   中英

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. 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

Or if you prefer the source code you should take a look at org.springframework.data.repository.query.parser.Part.Type

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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