Hi,
I am trying to join 2 tables with the following query:-
select person.first_name
from RefPerson person inner join RefTruck truck where truck.modify_person_num = person.person_num
and truck.modify_person_num = '1'
Schema of the classes is as follows:-
RefPerson:-
CREATE TABLE [dbo].[REF_PERSON] (
[person_num] [TPT_Num] NOT NULL ,
[first_name] [TPT_Name] NOT NULL ,
[last_name] [TPT_Name] NOT NULL ,
[middle_name] [TPT_Name] NULL ,
[person_initials] [TPT_Sm_3] NOT NULL ,
[company_num] [TPT_Num] NULL ,
[contact_type_cd] [TPT_Cd] NULL ,
[job_title_ind] [TPT_Ind] NOT NULL ,
[trading_desk_cd] [TPT_Cd] NULL ,
[login_cd] [TPT_Cd] NULL ,
[user_type_ind] [TPT_Ind] NOT NULL ,
[conf_contact_ind] [TPT_Ind] NULL ,
[invoice_contact_ind] [TPT_Ind] NULL ,
[note_num] [TPT_Num] NULL ,
[status_ind] [TPT_Ind] NOT NULL ,
[last_modify_dt] [TPT_Dt] NOT NULL ,
[lock_num] [TPT_Locknum] NOT NULL ,
[modify_person_num] [TPT_Num] NULL
)
RefTruck:-
CREATE TABLE [dbo].[REF_TRUCK] (
[mot_num] [TPT_Num] NOT NULL ,
[truck_cd] [TPT_Cd] NULL ,
[truck_name] [TPT_Cd_30] NULL ,
[status_ind] [TPT_Ind] NOT NULL ,
[last_modify_dt] [TPT_Dt] NOT NULL ,
[modify_person_num] [TPT_Num] NOT NULL ,
[lock_num] [TPT_Locknum] NOT NULL
)
However, I get the following exception in Hibern8IDE on query execution:-
1 errors occurred while listing (and calling getPathNames).
net.sf.hibernate.QueryException: outer or full join must be followed by path expression [select person.first_name
from com.tpt.physops.referencedata.tableobjects.RefPerson person inner join RefTruck truck where truck.modify_person_num = person.person_num
and truck.modify_person_num = '1']
What is wrong? I cant seem to get how to use joins with Hibernate.
|