Ben,
What does your schema look like? The SQL "DATE" type doesn't store a
time-of-day. The SQL "TIMESTAMP" type does. Some databases have different
types for DATE and TIMESTAMP although I believe Oracle uses the "date"
column type for both.
You might want to change the DATE to TIMESTAMP in your Torque schema XML
file and see if that helps.
-- Bill
----- Original Message -----
From: "Ben Hogan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 03, 2002 7:11 AM
Subject: oracle date insert problem
>
> If anyone can assist me with this one I would be VERY grateful:
>
> When I do a save() the DATE field in the database table has not had its
> Hours Min or Seconds set.
>
> So I am expecting a date with a time (eg 10am ) but get one with no time.
>
>
> Here is the test case that fails:
>
> public void testInsert() throws Exception {
> Country c = new Country();
> c.setCountryId(new StringKey("TEST"));
> c.setCountryDesc("Test Country");
> Date date = new GregorianCalendar(2002,0,11,10,5,0).getTime(); //
> fails also with = new Date()
> c.setCountryStartDate(date);
> c.setCurrencyCode("TST");
> c.save();
>
> // check date
> List countryList = CountryPeer.doSelect(new
> Criteria().add(CountryPeer.COUNTRY_ID, new StringKey("TEST")));
> assert("should have exactly 1 county inserted",
> countryList.size()==1);
> Country result = (Country) countryList.get(0);
> assertEquals("description not inserted", "Test Country",
> result.getCountryDesc());
> assertEquals("date should be exact match", date.getTime(),
> result.getCountryStartDate().getTime());
>
>
> }
>
> failing with "date should be exact match"...
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>