db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Braeuchi <jbraeu...@gmx.ch>
Subject Re: Extent tables unnecessarily added to query statement
Date Tue, 18 Mar 2003 19:32:52 GMT
hi ron,

you're right, my fix only handles extents and does not care for the main 
alias.
i'll fix it asap.

thanks
jakob

Ron Gallagher wrote:

>Based on what I'm seeing, it doesn't appear to be fixed.  I've attached a zip file with
new files/updates as well as a test case illustrate the issue.
>
>* repository_junit.xml defines two new extents for the org.apache.ojb.broker.Version class.
>* SimpleVersion.java and ComplexVersion.java represent the new extents to the Version
class
>* MultiExtentQueryTest.java runs a simple query that lists all Effectiveness entries where
version.versionValue1 is "xxx".  A worthless query, but it illustrates the point.
>
>Without the change, the generated sql looks like this:
>
>SELECT A0.eff_value3
>     , A0.eff_value2
>     , A0.eff_value1
>     , A0.pk
>     , A0.fk_to_version
>  FROM Effectiveness A0
>  INNER JOIN Version A1 ON A0.fk_to_version=A1.pk
>  LEFT OUTER JOIN Version A1E0 ON A0.fk_to_version=A1E0.pk
> WHERE A1.version_value1 =  'xxx'  OR A1E0.version_value1 =  'xxx' 
>
>With the change, the generated sql looks like this:
>
>SELECT A0.eff_value3
>     , A0.eff_value2
>     , A0.eff_value1
>     , A0.pk
>     , A0.fk_to_version
>  FROM Effectiveness A0
> INNER JOIN Version A1 ON A0.fk_to_version=A1.pk
> WHERE A1.version_value1 =  'xxx' 
>
>You can see that with the current code set, the "Version" table is joined to twice.  With
the change I've proposed, it is only joined to once.
>
>Ron Gallagher
>Atlanta, GA
>rongallagher@bellsouth.net
>
>  
>
>>From: Jakob Braeuchi <jbraeuchi@gmx.ch>
>>Date: 2003/03/17 Mon PM 12:47:45 EST
>>To: OJB Developers List <ojb-dev@db.apache.org>
>>Subject: Re: Extent tables unnecessarily added to query statement
>>
>>hi ron,
>>
>>imo i've fixed this one some time ago:
>>
>>hth
>>jakob
>>
>>    
>>
>
>  
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>For additional commands, e-mail: ojb-dev-help@db.apache.org
>


Mime
View raw message