[OJB-developers] Re: EqualToColumnCriteria an Aliases
Brought to you by:
thma
From: Oleg N. <on...@uk...> - 2002-05-17 22:08:21
|
Jakob, I prepared a simple test on the base of GraphTest and the generated SQL is okay. You can see this yourself at the very end of GraphTest.java. Could you please add an OJB testcase showing the problem? Thanks, Oleg On Friday 17 May 2002 16:37, Jakob Braeuchi wrote: > hi oleg, > > we need a clear definition for EqualToColumnCriteria when used with > aliases. imho the table name must be replaced by the alias, but i think the > column name should stay untouched. > > ie: PERSON.FIRSTNAME -> Ax.FIRSTNAME > > the current version of SqlManager also tries to translate the column name > and if it can't find a fielddescriptor it keeps the original name. > this leads to SqlExceptions because the table has an alias and the where > statement uses the table name: > > SELECT DISTINCT > A0.id,A0.vorname,A0.name,A0.adresse,A0.gebDat,A0.test,A0.isBoss,A0.entryDat >e ,A0.idPartner FROM tabPerson A0 WHERE A0.id = tabPerson.id > > the correct form of this really useless SQL should be: > > ... FROM tabPerson A0 WHERE A0.id = A0.id > > maybe we need an EqualToFieldCriteria where both table and field name are > translated ? > > jakob |