db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jakob Braeuchi (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OJB-21) retrieval of collection of objects with inheritance
Date Mon, 10 Oct 2005 19:37:48 GMT
    [ http://issues.apache.org/jira/browse/OJB-21?page=comments#action_12331741 ] 

Jakob Braeuchi commented on OJB-21:
-----------------------------------

testcase generates this sql:

SELECT A0.OBJ_ID,A0.NAME 
FROM INHERITANCE_CONSORTIUM A0 
INNER JOIN INHERITANCE_SHAREHOLDER A1 ON A0.OBJ_ID=A1.FK_CONSORTIUM 
INNER JOIN INHERITANCE_MANAGER A2 ON A1.OBJ_ID=A2.OBJ_ID AND A1.OBJ_ID_2=A2.OBJ_ID_2 
INNER JOIN INHERITANCE_EXECUTIVE A3 ON A2.OBJ_ID=A3.OBJ_ID AND A2.OBJ_ID_2=A3.OBJ_ID_2 
INNER JOIN INHERITANCE_EMPLOYEE A4 ON A3.OBJ_ID=A4.OBJ_ID AND A3.OBJ_ID_2=A4.OBJ_ID_2 
WHERE ((A0.NAME = ?) AND A1.SHARE_ = ?) AND A4.NAME = ?

SqlException : Column not found: FK_CONSORTIUM 


in the correct sql the joins for MANGER / SHAREHOLDER are flipped :!

SELECT A0.OBJ_ID,A0.NAME
FROM INHERITANCE_CONSORTIUM A0 
INNER JOIN INHERITANCE_MANAGER A1 ON A0.OBJ_ID=A1.FK_CONSORTIUM 
INNER JOIN INHERITANCE_SHAREHOLDER A2 ON A1.OBJ_ID=A2.OBJ_ID AND A1.OBJ_ID_2=A2.OBJ_ID_2 
INNER JOIN INHERITANCE_EXECUTIVE A3 ON A2.OBJ_ID=A3.OBJ_ID AND A2.OBJ_ID_2=A3.OBJ_ID_2 
INNER JOIN INHERITANCE_EMPLOYEE A4 ON A3.OBJ_ID=A4.OBJ_ID AND A3.OBJ_ID_2=A4.OBJ_ID_2 
WHERE ((A0.NAME = ?) AND A2.SHARE_ = ?) AND A4.NAME = ?



> retrieval of collection of objects with inheritance
> ---------------------------------------------------
>
>          Key: OJB-21
>          URL: http://issues.apache.org/jira/browse/OJB-21
>      Project: OJB
>         Type: Bug
>   Components: PB-API
>     Versions: 1.0.x CVS, 1.1 CVS
>  Environment: Linux Debian, Intel Pentium 4
>     Reporter: Dima

>
> Not possible to retrieve(possible update) collections of objects with inheritance. Collection
consist of derived type of object( not base). The result exception says that foreign key field
 not found in derived object(true, because it is in base). Tried with extensions, anonymous
etc.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
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