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: query for extents joining with null table
Date Tue, 08 Apr 2003 16:08:38 GMT
hi leandro,

could you please send me the java-classes, repository and the sql to 
create the necessary tables ?

jakob

Leandro Rodrigo Saad Cruz wrote:

>Hi Jacob !
>
>I'm upgrading from 0.9.8 to 1.0.rc2 an I got this problem :
>
>_________________       ________________
>|                |     |                |
>| AbstractClassA |1---*| AbstractClassB |
>|________________|     |________________|
>        ^                       ^
>        |                       |
>   -------------          ---------------   
>   |           |          |              |
> ____         ____       ____          ____
>|    |       |    |     |    |        |    |
>| A1 |       | A2 |     | B1 |        | B2 |
>|____|       |____|     |____|        |____|
>
>
>When I use OJB like this :
>
><java>
>Criteria crit = new Criteria()
>crit.addEqualTo("allBs.name",someName)
>QueryByCriteria query = new QueryByCriteria(AbstractClassA.class,crit);
>Collection result = broker.gteCollectionByQuery(query)
><java>
>
>I get an error because ojb is joinning with three tables
>AbstractClassB - NO TABLE
>B1             - TABLE_B_1
>B2             - TABLE_B_2
>
><sql>
>SELECT * 
>FROM TABLE_A_1 A0 INNER JOIN ((((((TABLE_A_VERSUS_B A1 INNER JOIN null
>A2 ON A1.AID_ID=A2.AID) LEFT OUTER JOIN TABLE_B_1 A2E1 ON
>A1.AID=A2E1.ID) LEFT OUTER JOIN TABLE_B_2 A2E2 ON ...
></sql>
>
>We are trying to join with the table that AbstractClassB should have,
>but it doesn't ! I looked at SqlQueryStatement.java and I'm not sure
>where I have to make modifications for this to work.
>
>When I first implemented extent aware path expressions I put a log
>warning (see createTableAlias(ClassDescriptor cld, String path)) about
>abstract classes, but I think there is not place anymore where we check
>for this !
>
>Can you help me solve this problem !
>
>
>  
>


Mime
View raw message