arizzi wrote:
michael wrote:
arbitary outer joins in HQL are not possible yet. You can use createSqlQuery to workaround probably.
Are they planned for the future?
I really need it.
Alessandro Rizzi
I had the same problem, but with createSQLQuery also i am not able to get. I need to get the data from multiple tables.
My Query is
mQuery = "select {smvo}.spmaterialidvc as {smvo.specialMaterialID},{smvo}.spmaterialnamevc as {smvo.displayName},{smvo}.plantidin as {smvo.plantID},{pvo}.plantnamevc as {pvo.plantName},{smvo}.customeridvc as {smvo.customerID},{cvo}.customernamevc as {cvo.customerName},{smvo}.vendoridvc as {smvo.vendorID},{vvo}.vendornamevc as {vvo.vendorName} from plant as {pvo}, customer as {cvo}, specialmaterial as {smvo} left outer join vendor as {vvo} on smvo.vendoridvc = vvo.vendoridvc where smvo.spmaterialidvc=:specialMaterialID and {smvo}.plantidin={pvo}.plantidin and smvo.customeridvc=cvo.customeridvc";
String[] aliases = {"smvo","pvo","cvo","vvo"};
Class[] loadclass = {SpecialMaterialVO.class,PlantVO.class,CustomerVO.class,VendorVO.class};
Query mSpecialMatQuery = mSession.createSQLQuery(mQuery,aliases,loadclass);
mSpecialMatQuery.setString("specialMaterialID","1234");
List myList = mSpecialMatQuery.list();
What type of object instances will be returned in the List myList? I am not able to type cast it.