You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by "Janssen, Roger" <ro...@ibanx.nl> on 2008/01/29 11:22:54 UTC

BUGREPORT : OJB 1.0.5 release candidate 1

 
Hi,

Finally migrating away from 1.0rc6 to 1.0.5rc1 ..... :)

Started migration our persistence layer around OJB, think a found a bug.

When we create a reportquery and want to execute a count first, we get a
ClassCastException.

Caused by: java.lang.ClassCastException:
org.apache.ojb.broker.query.EnclosingReportQuery
        at
org.apache.ojb.broker.util.BrokerHelper.getReportQueryByCriteriaCount(Un
known Source)
        at org.apache.ojb.broker.util.BrokerHelper.getCountQuery(Unknown
Source)
        at
org.apache.ojb.broker.core.PersistenceBrokerImpl.getCount(Unknown
Source)
        at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCount(Unknown
Source)
        at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCount(Unknown
Source)


Looking at the OJB source code:

In BrokerHelper : Query
getReportQueryByCriteriaCount(ReportQueryByCriteria aQuery)
    contains code : ReportQueryByCriteria countQuery =
(ReportQueryByCriteria) getQueryByCriteriaCount(aQuery);


In BrokerHelper : Query getQueryByCriteriaCount(QueryByCriteria aQuery)
    contains code : 
        if (aQuery.isDistinct())
        {
            countQuery.setDistinct(true);
            return new EnclosingReportQuery(countQuery, "count(*)");
        }

And class EnclosingReportQuery does not cast to
ReportQueryByCriteria!!!!

Hope this is enough info.

Greetings,

Roger Janssen
iBanx
*************************************************************************
The information contained in this communication is confidential and is intended solely for the use of the individual or entity to  whom it is addressed.You should not copy, disclose or distribute this communication without the authority of iBanx bv. iBanx bv is neither liable for the proper and complete transmission of the information has been maintained nor that the communication is free of viruses, interceptions or interference. 

If you are not the intended recipient of this communication please return the communication to the sender and delete and destroy all copies. 



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org