My domain has and Date field updated, that I want to search by
@Column(name = "updated")
Date updated;
I have a Java Date object representing a day, that's passed in by my endpoint's controller.
Date day;
and a crudrepository representing my data
public interface DataRepository extends CrudRepository<Data, Long> {
List<Data> findByLastUpdatedInDate(Date date);
}
Obviously the above method doesn't work, but is there something similar? Or am I going to have to do a find between then manually search for the last entry?
Edit: Here's how I get day; dateString is passed in by the controller.
SimpleDateFormat dateFormatIn = new SimpleDateFormat("yyyy-MM-dd");
Date day = dateFormatIn.parse(dateString);