spring-data provides a way to generate SQL search by defining the method name.
The following works fine:
@Entity
public class Book {
Date from, to;
}
//CrudRepository<Book>
findByFromDateBetween(Date departure, Date arrival);
But why then does the following not work?
findByFromDateBetweenAndToDateBetween(Date departure, Date arrival);
To connect two date searches, I have to repeat the date:
findByFromDateBetweenAndToDateBetween(Date departure, Date arrival, Date departure, Date arrival);
Question: is it possible to reuse the params?