db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Malakov (JIRA)" <j...@apache.org>
Subject [jira] Updated: (OJB-83) NullPointerException in SqlQueryStatement OJB 1.0.3
Date Fri, 16 Dec 2005 16:33:47 GMT
     [ http://issues.apache.org/jira/browse/OJB-83?page=all ]

Andy Malakov updated OJB-83:
----------------------------

    Attachment: testcase.zip

Added test case attachment:

Please do the following to reproduce:
 
1. Initialize your schema using OJB-test-tablealiasbug.SQL .
 
2. Run class test.tablealiasbug.TestTableAliasBug - it is JUnit testcase that also has main().

 


> NullPointerException in SqlQueryStatement OJB 1.0.3
> ---------------------------------------------------
>
>          Key: OJB-83
>          URL: http://issues.apache.org/jira/browse/OJB-83
>      Project: OJB
>         Type: Bug
>   Components: PB-API
>     Versions: 1.0.3, 1.0.4
>  Environment: Windows, Oracle 9.2
>     Reporter: Andy Malakov
>  Attachments: testcase.zip
>
> Hello All,
> When org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.TableAlias is used for abstract
class (has extent classes declared, but not mapped to any table itself) it may initialized
with tableName=null. This situation later produces a problem, because tableName is being used
for TableAlias identity (equals/hashcode):
> java.lang.NullPointerException
>  at org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement$TableAlias.hashCode(SqlQueryStatement.java:1977)
>  at java.util.HashMap.hash(HashMap.java:261)
>  at java.util.HashMap.put(HashMap.java:379)
>  at org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.splitCriteria(SqlQueryStatement.java:1686)
>  at org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.<init>(SqlQueryStatement.java:132)
>  at org.apache.ojb.broker.accesslayer.sql.SqlSelectStatement.<init>(SqlSelectStatement.java:64)
>  at org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.getSubQuerySQL(SqlQueryStatement.java:976)
>  at org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.appendSubQuery(SqlQueryStatement.java:957)
>  at org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.appendParameter(SqlQueryStatement.java:942)
>  at org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.appendInCriteria(SqlQueryStatement.java:770)
>  at org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.appendCriteria(SqlQueryStatement.java:849)
>  at org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.appendSQLClause(SqlQueryStatement.java:922)
>  at org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.asSQLStatement(SqlQueryStatement.java:671)
>  at org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.appendClause(SqlQueryStatement.java:592)
>  at org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.appendWhereClause(SqlQueryStatement.java:544)
>  at org.apache.ojb.broker.accesslayer.sql.SqlSelectStatement.getStatement(SqlSelectStatement.java:243)
>  at org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl.getPreparedSelectStatement(SqlGeneratorDefaultImpl.java:151)
>  at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(JdbcAccessImpl.java:305)
>  at org.apache.ojb.broker.accesslayer.RsQueryObject.performQuery(RsQueryObject.java:74)
>  at org.apache.ojb.broker.accesslayer.RsIterator.<init>(RsIterator.java:185)
>  at org.apache.ojb.broker.core.RsIteratorFactoryImpl.createRsIterator(RsIteratorFactoryImpl.java:58)
>  at org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFromQuery(PersistenceBrokerImpl.java:1918)
>  at org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorFromQuery(PersistenceBrokerImpl.java:1493)
>  at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:112)
>  at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:251)
>  at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:271)
>  at org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBrokerImpl.java:1367)
>  at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(DelegatingPersistenceBroker.java:338)
>  at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(DelegatingPersistenceBroker.java:338)
> Additional information: Unfortunately problem remains in OJB_1_0_RELEASE.
> Please look at SqlQueryStatement [line 128]:  m_root =
> createTableAlias(m_baseCld, hints=null, path="");
> When above line is called for abstract class descriptor (the one that has
> extent, but not mapped to a table itself) empty path causes variable
> lookForExtents=false, which in turn will result in
> TableAlias.tableName=null.

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