db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Goldstein <sdgol...@mailandnews.com>
Subject Bug with Data in Torque 3.0.2
Date Tue, 13 Jan 2004 04:34:15 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.GregorianCale
ndar[time=?,areFieldsSet=false,areAllFieldsSet=false,lenient=true,zone=sun.uti
l.
calendar.ZoneInfo[id="America/Los_Angeles",offset=-28800000,dstSavings=3600000
,u
seDaylight=true,transitions=185,lastRule=java.util.SimpleTimeZone[id=America/L
os
_Angeles,offset=-28800000,dstSavings=3600000,useDaylight=true,startYear=0,star
tM
ode=3,startMonth=3,startDay=1,startDayOfWeek=1,startTime=7200000,startTimeMode
=0
,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=7200000,endTimeMode=0]]
,f
irstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=?,YEAR=2004,MONTH=0,WEEK_OF_YEAR=
?,
WEEK_OF_MONTH=?,DAY_OF_MONTH=13,DAY_OF_YEAR=?,DAY_OF_WEEK=?,DAY_OF_WEEK_IN_MON
TH
=?,AM_PM=?,HOUR=?,HOUR_OF_DAY=?,MINUTE=?,SECOND=?,MILLISECOND=?,ZONE_OFFSET=?,
DS
T_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