You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Brian McCallister <mc...@forthillcompany.com> on 2004/09/09 01:33:12 UTC
Site & Tarballs
Quietly pushed 1.0.1 and updated the site.
Anyone care to make an announcement tomorrow (give mirrors time to pick
it up) ?
-Brian
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org
Re: broker.getCount()
Posted by Carlos Chávez <cc...@agssa.net>.
Carlos Chávez Escribio :-)
>
> Hi to all,
> i have the next code ("fac_estado_id" and "facNum" are Integer) :
>
> Criteria crit1 = new Criteria();
> crit1.addEqualTo("fac_num", facNum);
>
> Criteria crit2 = new Criteria();
> crit2.addEqualTo("max(fac_estado_id)", fac_estado_id);
>
> ReportQueryByCriteria query = new
> ReportQueryByCriteria(Facturaestado.class, crit1);
> query.setAttributes(new String[] { "fac_num" });
> query.addGroupBy(new String[] { "fac_num" });
> query.setHavingCriteria(crit2);
> boolean hasRecord = broker.getCount(query) > 0;
>
> Then the SQL of the code is:
> SELECT count(*) FROM FACTURAESTADO A0 WHERE A0.FAC_NUM = ? GROUP BY
> A0.FAC_NUM
>
> But i think that sql is wrong because do not have the having clause
> (query.setHavingCriteria(crit2);) i think the correc is:
>
> SELECT count(*) FROM FACTURAESTADO A0 WHERE A0.FAC_NUM = ? GROUP BY
> A0.FAC_NUM HAVING max(fac_estado_id) = ?
sorry the correct sql is:
SELECT count(*) FROM FACTURAESTADO A0 WHERE A0.FAC_NUM = ? GROUP BY
A0.FAC_NUM HAVING MAX(A0.FAC_ESTADO_ID) = ?
Cheers.
>
> o something like that.
>
> any idea ?
>
> Cheers.
>
> --
> Carlos Chávez
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
>
--
Carlos Chávez
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org
broker.getCount()
Posted by Carlos Chávez <cc...@agssa.net>.
Hi to all,
i have the next code ("fac_estado_id" and "facNum" are Integer) :
Criteria crit1 = new Criteria();
crit1.addEqualTo("fac_num", facNum);
Criteria crit2 = new Criteria();
crit2.addEqualTo("max(fac_estado_id)", fac_estado_id);
ReportQueryByCriteria query = new
ReportQueryByCriteria(Facturaestado.class, crit1);
query.setAttributes(new String[] { "fac_num" });
query.addGroupBy(new String[] { "fac_num" });
query.setHavingCriteria(crit2);
boolean hasRecord = broker.getCount(query) > 0;
Then the SQL of the code is:
SELECT count(*) FROM FACTURAESTADO A0 WHERE A0.FAC_NUM = ? GROUP BY
A0.FAC_NUM
But i think that sql is wrong because do not have the having clause
(query.setHavingCriteria(crit2);) i think the correc is:
SELECT count(*) FROM FACTURAESTADO A0 WHERE A0.FAC_NUM = ? GROUP BY
A0.FAC_NUM HAVING max(fac_estado_id) = ?
o something like that.
any idea ?
Cheers.
--
Carlos Chávez
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org