Closed as not planned
Description
Trying to execute the following query:
@Query(
"""
select * from bookings
where
employee_id = :employeeId and
to_date >= :from and
from_date <= :to and
slot in (:slots)
"""
)
fun findCollisionByEmployee(
employeeId: String,
to: LocalDate,
from: LocalDate,
slots: Collection<Booking.Slot>,
): Booking?
It throws with this message:
org.postgresql.util.PSQLException: Can't infer the SQL type to use for an instance of Booking$Slot. Use setObject() with an explicit Types value to specify the type to use.] with root cause
I tried to use a Converter<Booking.Slot, String>
but it does not get executed.
The expected result should be that queries use the same converters (e.i. enum to string) as other methods
Starter: org.springframework.boot:spring-boot-starter-data-jdbc:2.5.3