Re: [OJB-developers] enhanced report queries
Brought to you by:
thma
From: Jakob B. <jbr...@ho...> - 2002-03-11 20:33:14
|
hi, the report query stuff is now in the cvs. simple field names in functions are also resolved. ie: sum(salary) will be translated to sum(myTable.salary). this also works for selection criteria. jakob ----- Original Message ----- From: "Jakob Braeuchi" <jbr...@fr...> To: <obj...@li...> Sent: Saturday, March 09, 2002 10:26 PM Subject: [OJB-developers] enhanced report queries > hi, > > the attached zip contains some enhancements for reports (queries returning > rows not 'real' objects): > - define the columns to be selected (column names are properly resolved > using the field description if available) > - allow joins in selected columns > > System.out.println("\nreport (id,name,vorname,konti.saldo) with name like > '%er'"); > crit = new Criteria(); > crit.addEqualTo("name", "%er"); > query = new QueryByCriteria(Person.class, crit); > query.setColumns(new String[]{"id","name","vorname","konti.saldo"}); // > define the columns > broker.getReportQueryIteratorByQuery(query); > > this also allows some aggregate queries, but column names are NOT resolved > (no field decription for 'sum(test)' ): > > System.out.println("\nreport (sum(test) with name like '%er'"); > crit = new Criteria(); > crit.addEqualTo("name", "%er"); // uses Like > query = new QueryByCriteria(Person.class, crit); > query.setColumns(new String[]{"sum(test)"}); // column name is NOT > resolved here > broker.getReportQueryIteratorByQuery(query); > > > jakob > > thomas: if you find this patch useful, please let me know, and i'll check it > in to cvs. > > > > |