Hi everybody.
I have a question about hql queries.
Here is my code.
Code:
return session.createQuery(
"SELECT DISTINCT APFEE.FEEDESC, LicenseItem.APNO, CONTACT.CNTCTFIRST || ' '|| CONTACT.CNTCTLAST AS NAME, "+
"CONTACT.DAYPHN, CONTACT.CITY, CONTACT.STATE,CONTACT.ZIP, APFEE.QTY, LicenseItem.APKEY,"+
"LicenseItem.EXPDTTM, APFEE.AMT, CONTACT.ADDR1 || ' '|| CONTACT.ADDR2 AS ADDR "+
"FROM LicenseItem, APAPL, APFEE, APDEFN, CONTACT "+
"WHERE LicenseItem.APKEY=APAPL.APKEY) AND LicenseItem.APKEY=APFEE.APKEY) AND "+
"(LicenseItem.APDEFNKEY=APDEFN.APDEFNKEY) AND (APAPL.CNTCTKEY=CONTACT.CNTCTKEY) AND "+
"APFEE.STAT='U' AND LicenseItem.INACTVFLAG='N' AND APAPL.PRIM='Y' AND TRIMLicenseItem.APNO)= '?' ")
.setString(0, licenseNumber);
}
})
so here is the question I realize that I need the class name in the from statement for the LicenseItem table, but I don't know about APAPL, APFEE, APDEFN, CONTACT. This code is returning the result in the LicenseItem class, so do I need separate classes for APAPL, APFEE, APDEFN, CONTACT and the hbml.xml files too?
I just want to get the result back in the LicenseItem class. Thanks for your help