db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Murvai-Buzogány László <laszlo.murvai-buzog...@t-sys.hu>
Subject Re: Question with "addDate" and "andDate"!
Date Fri, 01 Aug 2003 14:31:20 GMT
Hi there,

just as a fast advice: conforming to Torque Javadocs, try using 
crit1.and(BookPeer.TIME, new GregorianCalendar(2003, 7, 1), 
Criteria.LESS_EQUAL) instead of andDate. Since addDate and andDate show 
handle dates in a similar way, there may be a problem in the implementation 
of the date-related and() function, which does not generate a mysql- 
compliant date-string from GregorianCalendar (that's why the serialized 
form og the GregorianCalendar object appears in the query).

What version of Torque are you using? It may be an issue already fixed in 
the latest version/s.

On Fri, 1 Aug 2003 21:03:02 +0800, sailorhero <sailorhero@hotmail.com> 
wrote:
> I use addDate() and andDate() to query some line .
>
> first:
> I want to know where is the diffirent between the two methods.

It differs in a very trivial manner: add* adds only one criterion, and the 
second time you call it, it replaces the first one. Add* functions are 
useful for adding one criterion to a query, or adding the first one. And* 
adds additional criterion, which then will be separated by 'and's in the 
query.


Best regards,
	Laszlo
-- 
Murvai-Buzogány László
T-Sys Kft.
Software developer
Tel.: (06)-1 436-8724
Laszlo.Murvai-Buzogany@t-sys.hu

---------------------------------------------------------------------
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