HQL produces bad SQL - unable to query on parent fields on class using joined-subclass
--------------------------------------------------------------------------------------
Key: HHH-3907
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3907
Project: Hibernate Core
Issue Type: Bug
Components: query-hql
Affects Versions: 3.2.6
Environment: Windows XP
Reporter: Elaine
Priority: Blocker
Hibernate: select specificemplo0_.person_ds_id as DATA1_395_, specificemplo0_2_.PERSON_ID
as PERSON2_395_, specificemplo0_2_.NAME as NAME395_, specificemplo0_2_.FIRST_NAME as
FIRST4_395_, specificemplo0_2_.MIDDLE_NAME as MIDDLE5_395_, specificemplo0_2_.LAST_NAME as
LAST6_395_, specificemplo0_2_.DATE_OF_BIRTH as DATE7_395_, specificemplo0_2_.PHONE_NUMBER
as PHONE8_395_, specificemplo0_2_.FAX_NUMBER as FAX9_395_, specificemplo0_2_.E_MAIL as
E10_395_, specificemplo0_2_.ADDRESS_ID as ADDRESS11_395_, specificemplo0_2_.STREET_LINE1
as STREET12_395_, specificemplo0_2_.STREET_LINE2 as STREET13_395_, specificemplo0_2_.CITY
as CITY395_, specificemplo0_2_.COUNTRY as COUNTRY395_, specificemplo0_2_.COUNTY as
COUNTY395_, specificemplo0_2_.STATE as STATE395_, specificemplo0_2_.ZIP_CODE as
ZIP18_395_, specificemplo0_1_.employee_id as employee2_396_, specificemplo0_1_.COMPANY_ID
as COMPANY3_396_, specificemplo0_1_.JOB_TITLE_DS_ID as JOB5_396_,
specificemplo0_1_.POSITION_DESC as POSITION8_396_,
specificemplo0_1_.EMERGENCY_CONTACT_DS_ID as EMERGENCY9_396_,
specificemplo0_1_.SHIFT_DS_ID as SHIFT10_396_, specificemplo0_1_.SUPERVISOR_DS_ID as
SUPERVISOR11_396_, specificemplo0_.EMPLOYEE_STATUS as EMPLOYEE7_399_, from
JL_EMPLOYEE_VIEW specificemplo0_ inner join CLA_EMPLOYEE specificemplo0_1_ on
specificemplo0_.person_ds_id=specificemplo0_1_.person_ds_id inner join CLA_PERSON
specificemplo0_2_ on specificemplo0_.person_ds_id=specificemplo0_2_.DATA_SOURCE_ID,
IFSAPP.CLA_COMPANY company1_ where specificemplo0_1_.COMPANY_ID=company1_.COMPANY_ID and
company1_.COMPANY_ID='MOD' and specificemplo0_.employee_id='P101'
ERROR [main] org.hibernate.util.JDBCExceptionReporter (JDBCExceptionReporter.java:78) -
ORA-00904: "SPECIFICEMPLO0_"."EMPLOYEE_ID": invalid identifier
Mapping file:
has 2 joined-subclasses
this is the gist of th mappnig file...
<class Person table="cla_person" polymorphism="implicit">
<id = data_source_id/>
<joined-subclass Employee extends person table="cla_employee">
<key = pesron_ds_id/>
<porperty name ="employeeId "......coulmn="EMPLOYEE_ID">
<porperty name ="company"......>
<joined-subclass SpecificEmployee extends Employee table=jl_employee_view>
<key = person_ds_id/>
</joined-subclass>
</joined-subclass>
</class>
HQL : from SpecificEmployee where company.companyId='MOD' and employeeId =
'P101'
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira