FAQ
I have a mysql database we are using with Cayenne...The column type in mysql is datetime.

When accessing the returned objects in Cayenne they all have the time set to 00:00:00 but the date is valid. The mysql database has the time and date correct.

The java date object is able to handle the time...

Not sure what Cayenne is doing to the time portion of the date?

It is a straight query against the database to return a list of objects....

Thanks,
Tony

Search Discussions

  • Michael Gentry at Jun 7, 2011 at 1:30 pm
    Hi Tony,

    I think you may want a Timestamp instead.

    mrg

    On Mon, Jun 6, 2011 at 7:01 PM, Tony Dahbura wrote:

    I have a mysql database we are using with Cayenne...The column type in
    mysql is datetime.

    When accessing the returned objects in Cayenne they all have the time set
    to 00:00:00 but the date is valid. The mysql database has the time and date
    correct.

    The java date object is able to handle the time...

    Not sure what Cayenne is doing to the time portion of the date?

    It is a straight query against the database to return a list of objects....

    Thanks,
    Tony


  • Tony Dahbura at Jun 7, 2011 at 3:11 pm
    That worked. I used a java.sql.timestamp in the modeler for it.

    In the past used to have issues with java.sql.timestamp...Cayenne seems to not have any issues with them!!!

    Tony


    ----- Original Message -----
    From: "Michael Gentry" <mgentry@masslight.net>
    To: "Cayenne Users" <user@cayenne.apache.org>
    Sent: Tuesday, June 7, 2011 9:29:47 AM
    Subject: Re: Quick question about Date and Time database types

    Hi Tony,

    I think you may want a Timestamp instead.

    mrg

    On Mon, Jun 6, 2011 at 7:01 PM, Tony Dahbura wrote:

    I have a mysql database we are using with Cayenne...The column type in
    mysql is datetime.

    When accessing the returned objects in Cayenne they all have the time set
    to 00:00:00 but the date is valid. The mysql database has the time and date
    correct.

    The java date object is able to handle the time...

    Not sure what Cayenne is doing to the time portion of the date?

    It is a straight query against the database to return a list of objects....

    Thanks,
    Tony


Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedJun 6, '11 at 11:05p
activeJun 7, '11 at 3:11p
posts3
users2
websitecayenne.apache.org

2 users in discussion

Tony Dahbura: 2 posts Michael Gentry: 1 post

People

Translate

site design / logo © 2022 Grokbase