I'm trying to build a query where records are selected when a column
containing a date falls between 2 user supplied dates. The code I'm
using looks something like this (the names have been changed to protect
the innocent):

Criteria criteria = new Criteria();
Vector victor = new Vector();
Criteria.Criterion a = criteria.getNewCriterion(SomePeer.CREATED_DATE,
new GregorianCalendar(fyy, fmm, fdd), Criteria.GREATER_EQUAL);
Criteria.Criterion b = criteria.getNewCriterion(SomePeer.CREATED_DATE,
new GregorianCalendar(tyy, tmm, tdd), Criteria.LESS_EQUAL);
criteria.add(a.and(b));
victor = SomePeer.doSelect(criteria);

However, when I try to execute the query, the SQL that is being
generated contains (what looks like) a serialized copy of the
GregorianCalendar objects, rather than something that looks like a date.

Reading from the Turbine API and looking at the source code for
org.apache.turbine.util.db.Criteria I think I'm taking the right
approach, but of course on the other hand I'm probably doing something
dumb.

Any help on this one is appreciated!!

Thanks and regards,

Matt

--
   ____  | Matthew J. Forder         | Data Center Supervisor
  / / () | Seagate Techology         | Tel:+31 20 316 7468
  \ \ \  | Koolhovenlaan 1           | Fax:+31 20 653 5537
 ()_/_/  | 1119 NB Schiphol-Rijk, NL | [EMAIL PROTECTED]
begin:vcard 
n:Forder;Matthew
tel;cell:+31 65 350 8743
tel;fax:+31 20 653 5537
tel;work:+31 20 316 7468
x-mozilla-html:TRUE
url:http://www.seagate.com/
org:<i>Seagate Technology LLC</i>;<a href="http://www.seagate.com/";><img src="http://www.seagate.com/images/doors/frontdoor/logo.gif"; width=99 height=24 border=0 vspace=3 alt="Seagate" align=right></a>
adr:;;Koolhovenlaan 1;Schiphol-Rijk;North Holland;1119 NB;Netherlands
version:2.1
email;internet:[EMAIL PROTECTED]
title:<b>Datacenter Supervisor</b>
x-mozilla-cpt:;-25048
fn:Matthew Forder
end:vcard

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to