db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hidde Boonstra [Us Media]" <hidde.boons...@usmedia.nl>
Subject Re: SQL TIMESTAMP and Torque java.util.Date mapping.
Date Thu, 07 Aug 2008 10:38:40 GMT
Hi,

criteria.add(TestPeer.EXPIRES, (Object) null, Criteria.ISNULL)

doesn't work?

Regards,

Shinkan wrote:
> Hi again there !
> 
> I have a TIMESTAMP type column in a schema, and the Torque maps it to
> java.util.Date, which is really convenient most of the time.
> BUT, I would like to check for this column nullity, SQL point-of-view.
> That's to say, I have to check that this field, let's call it "expires", is
> NULL Timestamp (00-00-0000 00:00:00).
> Trying to compare expires against new Date(0) fails as new Date(0) gives
> (and that's obvious), the first UNIX timestamp date.
> I can use New Date(int, int, int, int, int, int) BUT it is deprecated, and I
> really would like to avoid this.
> 
> So, how can I build a Criteria to check if my field "expires" from table
> "test" is NULL timestamp (00-00-0000 00:00:00) ?
> timeCrit.add( TestPeer.EXPIRES, ?????????);
> 
> Thanks in advance !
> 

-- 
Hidde Boonstra
Us Media B.V.
Stadhouderskade 115
1073 AX Amsterdam

t: 020 428 68 68
f: 020 470 69 05
www.usmedia.nl

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