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 Thomas Quaile <to...@yahoo.com> on 2003/08/23 04:42:43 UTC

Need help with ReportQueryByCriteria

I'm working on a report query that combines multiple
tables into 1 class.  My questions are; 

If I use the .addSql method on the Criteria object and
do straight SQL that combines my tables and returns
the columns I want, do I have to put a
class-descriptor in the repository?

If so, what do I put in the repository since my query
combines multiple tables?

Example (real query is much more complex than this,
but this gives the general idea);

Criteria criteria = new Criteria();

String sql = "SELECT table1.column1, table2,column1,
sum(table3.column1) FROM table1, table2, table3 WHERE
table1.id = table2.id AND table1.id = table3.id GROUP
BY table1.column1, table2.column1";

criteria.addSql(sql);

ReportQueryByCriteria reportQuery =
QueryFactory.newReportQuery(ReportObject.class,
criteria);

Thanks...

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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