ojb-user@db.apache.org
[Top] [All Lists]

BUGREPORT : OJB 1.0.5 release candidate 1

Subject: BUGREPORT : OJB 1.0.5 release candidate 1
From: "Janssen, Roger"
Date: Tue, 29 Jan 2008 11:22:54 +0100
 
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@xxxxxxxxxxxxx
For additional commands, e-mail: ojb-user-help@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>