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 Sy...@swisscom.com on 2003/03/24 10:34:29 UTC

Which object comes from ReportQueries ?

Hello,

I'm trying to use ReportQueries. Here my code:

----code----
String sql = "select w.workstationType from Workstation w";

Query query = QueryFactory.newQuery(Workstation.class, sql);

try {
	broker.beginTransaction();
	Iterator iter = broker.getReportQueryIteratorByQuery(query);

	while (iter.hasNext()) {
	Workstation workstation = (Workstation) iter.next();
	System.out.println(workstation.getWorkstationName());
	}
			
	broker.commitTransaction();
} catch (Throwable t) {
	broker.abortTransaction();
	t.printStackTrace();
}

But it doesn't work (ClassCastException)!
My question is: which object the getReportQueryIteratorByQuery method returns?
In this case it seems that it isn't a Workstation object.

Could you help me?

Thanks
Sylvain