Насколько мне известно, когда для генерации sql используется API критериев гибернации, специфический запрос языка объектной модели генерируется перед собственным sql.
Но какой запрос генерируется.Это HQL или JPQL?
Настраивается ли это?
Зависит ли это от базы данных?
Пример вывода из консоли, когда я установил "hibernate.show.sql = true":
Hibernate:
/* SELECT
o
FROM
MuhasebeBirimi o
WHERE
o.muhasebeBirimiVergiNo=:parameter1 */ select
muhasebebi0_.ID as ID1_41_,
muhasebebi0_.VERSION as VERSION2_41_,
muhasebebi0_.CREATION_TS as CREATION3_41_,
muhasebebi0_.UPDATE_TS as UPDATE_T4_41_,
muhasebebi0_.ADI as ADI5_41_,
muhasebebi0_.IL_ID as IL_ID9_41_,
muhasebebi0_.ILCE_ID as ILCE_ID10_41_,
muhasebebi0_.DURUM as DURUM6_41_,
muhasebebi0_.MUHASEBE_BIRIMI_NO as MUHASEBE7_41_,
muhasebebi0_.MUHASEBE_BIRIMI_VERGI_NO as MUHASEBE8_41_
from
MUHASEBE_BIRIMI muhasebebi0_
where
muhasebebi0_.MUHASEBE_BIRIMI_VERGI_NO=?
Hibernate:
/* SELECT
DISTINCT o
FROM
Etiket o
WHERE
(
o.muhasebeBirimiId IS NULL
OR o.muhasebeBirimiId=:parameter1
)
ORDER BY
o.id DESC */ select
distinct etiket0_.ID as ID1_13_,
etiket0_.VERSION as VERSION2_13_,
etiket0_.CREATION_TS as CREATION3_13_,
etiket0_.UPDATE_TS as UPDATE_T4_13_,
etiket0_.ACIKLAMA as ACIKLAMA5_13_,
etiket0_.ADI as ADI6_13_,
etiket0_.ETIKET_KAYNAGI as ETIKET_K7_13_,
etiket0_.ETIKET_TURU as ETIKET_T8_13_,
etiket0_.MUHASEBE_BIRIMI_ID as MUHASEBE9_13_
from
ETIKET etiket0_
where
etiket0_.MUHASEBE_BIRIMI_ID is null
or etiket0_.MUHASEBE_BIRIMI_ID=?
order by
etiket0_.ID DESC limit ?