Here is my entity which is saving the timestamp
@Temporal(TemporalType.TIMESTAMP)
private Date transactionTime;
and here is my Service layer to fetch the data based on transactionDate
Timestamp transactionTimeStamp = new Timestamp(record.getTransactionDate().getTime());
Result result = repository.findByDate(transactionTimeStamp).orElse(null);
Here is my repository layer
@Query("select tr from record tr where tr.transactionDate = :transactionDate")
Optional<Result> findByDate(@Param("transactionDate") Timestamp transactionDate);
Although query generated in the logs I am able to fetch the data
but in code I am not able to get any data and its always null.
Not sure what is the reason.
I am using mysql database
Script to create table has this line
transaction_date DATETIME,