Я использую спящий режим.У меня есть список.Я использую hql на слое дао.Но моего списка не существует.Но я открыл show_sql = true.Тогда родной sql работает.Почему мой собственный sql работает, но hql не работает.
Hibernate Query
customers = entityManager.createQuery(
"SELECT c FROM LoungeCustomerCash c where c.operationDate between :beginDate and :endDate and c.boardingPass.operatingCarrierDesignator= :iataCode ORDER BY c.operationDate DESC")
.setParameter("iataCode", iataCode).setParameter("beginDate", beginDate)
.setParameter("endDate", endDate).getResultList();
Собственный запрос Sql:
select loungecust0_.id as id2_59_, loungecust0_.CREATEDATE as CREATEDATE3_59_, loungecust0_.CREATEUSER as CREATEUSER4_59_, loungecust0_.UPDATEDATE as UPDATEDATE5_59_, loungecust0_.UPDATEUSER as UPDATEUSER6_59_, loungecust0_.VERSION as VERSION7_59_, loungecust0_.BOARDINGPASSID as BOARDINGPASSID14_59_, loungecust0_.customerType as customerType8_59_, loungecust0_.fullName as fullName9_59_, loungecust0_.LOUNGESERVICEID as LOUNGESERVICEID15_59_, loungecust0_.operationDate as operationDate10_59_, loungecust0_.price as price11_59_, loungecust0_.bankName as bankName12_59_ from LNCUSTOMER loungecust0_ cross join LNBOARDINGPASS boardingpa1_ where loungecust0_.service_type='CASH' and loungecust0_.BOARDINGPASSID=boardingpa1_.id and (loungecust0_.operationDate between to_timestamp('23/09/2018 11:09:02,660000000','DD/MM/RRRR HH24:MI:SSXFF') and to_timestamp('23/12/2018 11:09:02,660000000','DD/MM/RRRR HH24:MI:SSXFF') ) and boardingpa1_.operatingCarrierDesignator='LH' order by loungecust0_.operationDate DESC