[OJB-developers] SqlStatement
Brought to you by:
thma
From: Jakob B. <jbr...@ho...> - 2002-05-16 05:52:00
|
hi oleg, i have a problem with ms-access (to support it is an ojb feature) and joins using the current version of SqlStatement. SELECT DISTINCT A0.id,A0.idPerson,A0.nummer,A0.saldo FROM tabKonto A0 INNER JOIN tabPerson A1 ON A0.idPerson=A1.id INNER JOIN tabTelefon A2 ON A1.id=A2.idPerson WHERE (A0.saldo>?) AND A2.tel_nr LIKE ? this is perfect for mysql but ms-access needs ( ) around nested joins : SELECT DISTINCT A0.id,A0.idPerson,A0.nummer,A0.saldo FROM (tabKonto A0 INNER JOIN tabPerson A1 ON A0.idPerson=A1.id) INNER JOIN tabTelefon A2 ON A1.id=A2.idPerson WHERE (A0.saldo>?) AND A2.tel_nr LIKE ? i've attached a fixed SqlStatement that works with mysql and ms-access, but i've NOT tested it with hsql and others. could you please have a look at it ? when tryinig to understand your code, i saw that you make heavy use of instance variables. this is undoubtably perfect for performance, but i think it will complicate future refactorings. i prefer parameter passing (ie: for stmt in appendTableWithJoins() ). just my 0.02 CHF jakob ----- Original Message ----- From: "Oleg Nitz" <on...@uk...> To: <obj...@li...> Sent: Wednesday, May 15, 2002 10:23 PM Subject: Re: [OJB-developers] Re: > Hi Jakob, > > I made the HSQL syntax the default, it seems to be okay for all RDBMS except > for Oracle and Sybase. > > Regards, > Oleg > > On Wednesday 15 May 2002 18:42, Jakob Braeuchi wrote: > > hi oleg, > > > > yes the changed order of joins solves the problem in mysql. > > > > jakob > > > > |