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 Edson Carlos Ericksson Richter <ed...@mgrinformatica.com.br> on 2003/09/09 16:29:31 UTC
ReportQueryByCriteria and Extents problem
I'm facing a problem with ReportQueryByCriteria and extends. I've 3 classes
that extends an abstract one:
<class-descriptor class="ItemAbstract">
<extent-class class-ref="ItemValue" />
<extent-class class-ref="ItemPercent" />
<extent-class class-ref="ItemScript" />
</class-descriptor>
ItemAbstract has properties "id", "personId", "order". Each other has other
properties that makes no diff for our example.
Now, I want the max( order ) for any of above. The way I think I should do
it is
Criteria c = new Criteria( );
c.addEqualTo( "personId", cp );
c.addEqualTo( "id", cd );
ReportQueryByCriteria q = new ReportQueryByCriteria( ItemAbstract.class,
new String [] {
"max( order )"
}, c );
When I execute this command, I'm expecting that OJB will issue
select max(nu_ordem) from
(select nu_ordem from tb_compttpessoa_taxa
union
select nu_ordem from tb_compttpessoa_percent
union
select nu_ordem from tb_compttpessoa_script )
that works fine in SapDB. But OJB is issuing three queries...
It's a bug, or a expected feature?
Thanks,
Edson Richter
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.515 / Virus Database: 313 - Release Date: 1/9/2003
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org