db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Goldstein <sdgol...@mailandnews.com>
Subject I meant - Bug with Calendar Query in Torque 3.0.2
Date Tue, 13 Jan 2004 06:11:13 GMT
I'm trying to create a query with the following criteria:

Criteria selectCriteria = new Criteria();
selectCriteria.addDate(TablePeer.DATE,
date.get(Calendar.YEAR),
date.get(Calendar.MONTH),
date.get(Calendar.DAY_OF_MONTH),
Criteria.GREATER_EQUAL);

date.add(Calendar.DAY_OF_MONTH, 1);

selectCriteria.andDate(TablePeer.DATE,
date.get(Calendar.YEAR),
date.get(Calendar.MONTH),
date.get(Calendar.DAY_OF_MONTH),
Criteria.LESS_THAN);

>From the database log, I can see that this is producing the following query:

SELECT table.ID, table.DATE FROM table WHERE (table.DATE>='20040112000000' AND 
table.DATE<java.util.GregorianCalendar[time=?,areFieldsSet=false,areAllFieldsS
et=false,lenient=true,zone=sun.uti
l.calendar.ZoneInfo[id="America/Los_Angeles",offset=-28800000,dstSavings=36000
00
,useDaylight=true,transitions=185,lastRule=java.util.SimpleTimeZone[id=America
/L
os_Angeles,offset=-28800000,dstSavings=3600000,useDaylight=true,startYear=0,st
ar
tMode=3,startMonth=3,startDay=1,startDayOfWeek=1,startTime=7200000,startTimeMo
de
=0,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=7200000,endTimeMode=0
]]
,firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=?,YEAR=2004,MONTH=0,WEEK_OF_YEA
R=
?,WEEK_OF_MONTH=?,DAY_OF_MONTH=13,DAY_OF_YEAR=?,DAY_OF_WEEK=?,DAY_OF_WEEK_IN_M
ON
TH=?,AM_PM=?,HOUR=?,HOUR_OF_DAY=?,MINUTE=?,SECOND=?,MILLISECOND=?,ZONE_OFFSET=
?,
DST_OFFSET=?])

It looks like rather than getting the time, it's performing a 
Calendar.toString()

Is this is known issue? Is it fixed in later releases?

Thanks for the help.

Scott


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message