[OJB-developers] Re:
Brought to you by:
thma
From: Oleg N. <on...@uk...> - 2002-05-15 08:05:54
|
Hi Jakob, Is you version of MySQL okay with the query SELECT DISTINCT A0.id,A0.idPerson,A0.nummer,A0.saldo FROM (tabPerson A1 INNER JOIN tabTelefon A2 ON A1.id=A2.idPerson) INNER JOIN tabKonto A0 ON A0.idPerson=A1.id WHERE A2.tel_nr LIKE ? I can change the order of joins, no problem. The alternative SQL92 syntax is used in HSQL, you could try it with MySQL, just append public byte getJoinSyntaxType() { return HSQL_JOIN_SYNTAX; } to PlatformMySQLImpl.java Regards, Oleg On Wednesday 15 May 2002 08:59, Jakob Braeuchi wrote: > hi oleg, > > i have a problem with the new SqlStatement: > > [ojb.broker.accesslayer.SqlGenerator] DEBUG: SQL: SELECT DISTINCT > A0.id,A0.idPerson,A0.nummer,A0.saldo FROM tabKonto A0 INNER JOIN (tabPerson > A1 INNER JOIN tabTelefon A2 ON A1.id=A2.idPerson) ON A0.idPerson=A1.id > WHERE A2.tel_nr LIKE ? > > this produces a syntax error in mysql : syntax error near (tabPerson A1 > INNER JOIN.... > > the query i execute is the following: > > Query query; > Criteria crit; > crit = new Criteria(); > crit.addEqualTo("inhaber.telefone.nummer", "031%"); > query = new QueryByCriteria(Konto.class, crit, true); > showResult(broker.getCollectionByQuery(query)); > > jakob |