db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Gallagher <rgall...@bellsouth.net>
Subject Re: Extent tables unnecessarily added to query statement
Date Mon, 17 Mar 2003 20:39:39 GMT
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
> 


Mime
View raw message