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-94) NPE when execute query (join via 1:n reference) on objects using "table-per-subclass"-inheritance
Date Sat, 04 Feb 2006 20:19:03 GMT
    [ http://issues.apache.org/jira/browse/OJB-94?page=comments#action_12365181 ] 

Jakob Braeuchi commented on OJB-94:
-----------------------------------

manager name can now be resolved. but A4 and A5 are redundant.

SELECT DISTINCT A0.OBJ_ID,A0.NAME 
FROM INHERITANCE_CONSORTIUM A0 
INNER JOIN INHERITANCE_MANAGER A1 ON A0.OBJ_ID=A1.FK_CONSORTIUM 
INNER JOIN INHERITANCE_EXECUTIVE A2 ON A1.OBJ_ID=A2.OBJ_ID AND A1.OBJ_ID_2=A2.OBJ_ID_2 
INNER JOIN INHERITANCE_EMPLOYEE A3 ON A2.OBJ_ID=A3.OBJ_ID AND A2.OBJ_ID_2=A3.OBJ_ID_2 

INNER JOIN INHERITANCE_ADDRESS A6 ON A3.FK_ADDRESS=A6.OBJ_ID 

INNER JOIN INHERITANCE_EXECUTIVE A4 ON A1.OBJ_ID=A4.MANAGER_ID AND A1.OBJ_ID_2=A4.MANAGER_ID_2

INNER JOIN INHERITANCE_EMPLOYEE A5 ON A4.OBJ_ID=A5.OBJ_ID AND A4.OBJ_ID_2=A5.OBJ_ID_2 

WHERE ((A0.NAME = 'testInheritedReferences_1139084041812') 
AND A6.STREET = 'testInheritedReferences_1139084041812_street_12') 
AND A3.NAME = 'testInheritedReferences_1139084041812_Manager'

> NPE when execute  query (join via 1:n reference) on objects using "table-per-subclass"-inheritance
> --------------------------------------------------------------------------------------------------
>
>          Key: OJB-94
>          URL: http://issues.apache.org/jira/browse/OJB-94
>      Project: OJB
>         Type: Bug
>     Versions: 1.0.4
>     Reporter: Armin Waibel

>
> The NPE is caused by SqlQueryStatement.buildSuperJoinTree
> Criteria crit = new Criteria()
>         .addEqualTo("name", consortium.getName())
>         .addEqualTo("managers.executives.address", name + "_street_12")
>         .addEqualTo("managers.name", name + "_Manager");
> Query q = QueryFactory.newQuery(Consortium.class, crit);
> Caused by: java.lang.NullPointerException
> 	at org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.buildSuperJoinTree(SqlQueryStatement.java:1798)
> 	at org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.getTableAlias(SqlQueryStatement.java:1210)
> 	at org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.buildJoinTreeForColumn(SqlQueryStatement.java:1774)
> 	at org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.buildJoinTree(SqlQueryStatement.java:1751)
> 	at org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.splitCriteria(SqlQueryStatement.java:1855)
> 	at org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.<init>(SqlQueryStatement.java:154)

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