[OJB-developers] additional capabilities for report queries, OUTER JOIN ?
Brought to you by:
thma
From: Jakob B. <jbr...@ho...> - 2002-03-22 07:02:34
|
hi, i just added additional capabilities for report queries to the cvs. ojb now supports groupBy and functions on columns for report queries. crit = new Criteria(); crit.groupBy("id"); query = QueryFactory.newReportQuery(Person.class, crit); query.setColumns(new String[]{"id","name","vorname","sum(konti.saldo)"}); broker.getReportQueryIteratorByQuery(query); // sum(konti.saldo) now handled correctly this will execute the following sql: SELECT tabPerson.id,tabPerson.name,tabPerson.vorname,sum(tabKonto.saldo) FROM tabPerson INNER JOIN tabKonto ON tabKonto.idPerson = tabPerson.id GROUP BY tabPerson.id i need some help/input in the following issue: the query will only return id, name etc. for persons having at least one account. to retrieve data from persons without an account the join clause should be changed to "LEFT OUTER JOIN". i'm now looking for a way to define the join type: - should it be defined for criteria or query ? - is there are way to automagically detect th join type ? - is join type only an issue for report queries ? any input and help will be appreciated. jakob |