In my entity I have two values openTime
and closeTime
both of the type OffsetTime
, now I want to retrieve the entity where the current time is between the openTime and closeTime, but the problem I now have what if openTime = '23:00:00'
and closeTime = '05:00:00'
, meaning that the entity is open at evening and during night.
I have the following query:
SELECT s FROM ShopArticle s LEFT JOIN FETCH s.openTimes t WHERE t.openTime < :time AND t.day = :day`
where :time
is of type OffsetTime
and :day
of type DayOfWeek
. I can't change openTime to DateTime or sth else, so how do I do this?