I have the following entity:
@Entity
public class A implements Serializable {
@EmbeddedId
private AId id;
...
public static class AId implements Serializable {
@Column
private LocalDate date;
@Column
private String description;
}
}
I'm trying to get all the A
with a specific date
. For that, I have created the following repository:
public interface ExchangeRateRepository extends JpaRepository<A, A.AId> {
Optional<ExchangeRate> findByIdDate(LocalDate date);
}
However, this method always returns Optional.empty()
. I'm using Hibernate 5.4, so compatibility issues with java.time
should be fixed... I don't know what to do
EDIT #1
The generated query is the following:
select id, date, description from a where date=?
2023-03-14 11:00:08.514 TRACE 2148 --- [main] o.h.type.descriptor.sql.BasicBinder: binding parameter [1] as [DATE] - [2023-03-13]