Hibernate不考虑列别名

时间:2015-04-01 08:46:11

标签: hibernate jpa jpa-2.0

我尝试在HQL下面运行。虽然我已经为列指定了别名,但是hibernate没有考虑到这一点。

以下是HQL:

SELECT et1.entitlementId as A, et1.admTCId as B, 
          et1.barCode as C,et1.inactiveDate as D,
          et1.isEEntitlement as E,et1.magStripNumber as F,
          et1.serialNumber as G,et1.ticketBankInd as H 
FROM com.wdw.resmanagement.data.entity.AdmissionComponentEntitlement et1 
WHERE et1.inactiveDate IS NULL AND et1.serialNumber = :serialNumber 

Hibernate生成的相应SQL:

select
    admissionc0_.adm_enttl_id as col_0_0_,
    admissionc0_.adm_tc_id as col_1_0_,
    admissionc0_.brcd_vl as col_2_0_,
    admissionc0_.adm_enttl_inactv_dt as col_3_0_,
    admissionc0_.e_enttl_in as col_4_0_,
    admissionc0_.mag_strp_vl as col_5_0_,
    admissionc0_.serial_nb_vl as col_6_0_,
    admissionc0_.tkt_bank_in as col_7_0_ 
from
    RES_MGMT.adm_cmpnt_enttl admissionc0_ 
where
    (
        admissionc0_.adm_enttl_inactv_dt is null
    ) 
    and admissionc0_.serial_nb_vl=?

我正在使用Oracle 10g数据库。

有人可以知道我应该更改什么来在SQL中获取相同的别名(hibernate正在生成)?

0 个答案:

没有答案