> Do you simply want all vehicles (?) with vehicleEquipments.code 580 or U11 ?

I want all vehicles that have a vehicleEquipments.code '580' and a
vehicleEquipments.code 'U11'. there is a 1:n relationship between
vehicle and equipment

> Looking at your extract of code, and your extract from the spy log, OJB
> seems to be doing exactly what you've asked it to.

the resulting sql in the spy log is exactly what i want, except for the
aliases (A0-A3) in the FROM clause don't match the aliases in the WHERE
clause and i get a syntax error.

thanks,
Michael

> >I have a problem with a PB query and aliases for joined tables. I build
> >a criteria like this to join the vehicle table with the equipment table
> >twice:
> >
> >criteria1.addEqualTo("vehicleEquipments.code", "580");
> >criteria1.setAlias("EQUIPEMNT1");
> >
> >criteria2.addEqualTo("vehicleEquipments.code", "U11");
> >criteria2.setAlias("EQUIPEMNT2");
> >
> >criteria3.addAndCriteria(criteria1);
> >criteria3.addAndCriteria(criteria2);
> >
> >the resulting query fails because of the assigned aliases of the joined
> >equipment tables. From the p6spy log:
> >
> >SELECT A0.VEHI_RELEASE_TS, ...
> >
> >FROM (V0QRVEHI A0 INNER JOIN V0QRVEEQ A1 ON 
> >A0.VEHI_KEY=A1.VEEQ_VEHI_KEY)
> >INNER JOIN V0QRVEEQ A2 ON A0.VEHI_KEY=A2.VEEQ_VEHI_KEY
> >
> >WHERE ( A3.VEEQ_CODE =  '580' ) AND  (A2.VEEQ_CODE =  'U11' )
> >
> >the FROM clause uses A1 and A2 as aliases for the equipment 
> >tables where
> >as the JOIN clause uses A2 and A3. It works fine if i don't assign an
> >alias to criteria1.
> >
> >Is there anything i do wrong or is this a bug in OJB?
> >
> >I use 1.0 rc3 with jdk 1.4.1.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to