You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Marc O'Morain (Created) (JIRA)" <ji...@apache.org> on 2011/10/04 19:51:35 UTC

[jira] [Created] (CAY-1626) Add JodaTime DateTime support

Add JodaTime DateTime support
-----------------------------

                 Key: CAY-1626
                 URL: https://issues.apache.org/jira/browse/CAY-1626
             Project: Cayenne
          Issue Type: Improvement
          Components: Database integration
    Affects Versions: 3.1M2
            Reporter: Marc O'Morain
         Attachments: DateTimeType.java

Here is some code that we wrote at Swrve to load/save jodatime DateTime objects with Cayenne

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAY-1626) Add JodaTime DateTime support

Posted by "John Huss (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1626?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Huss updated CAY-1626:
---------------------------

    Attachment: joda-patch.txt

The attached file has some issues:
- The string format of the timestamp is database specific so it can't be relied upon. For example with Postgres this doesn't work. To avoid problems with the driver changing the time zone you should modify the driver or just change the default time zone of your app to use GMT.
- Using a string with this format limits the precision of the time value since milliseconds are only given to 1 decimal place.

I'm interested in the Joda time library myself, so I took a stab at doing this and also added support for some of the other useful joda classes.
So my patch has support for: DateTime, LocalDate, and LocalTime.  It also includes the custom serializers necessary for using these classes in an ROP app.  The patch has new classes only.  The new extended types and serializers aren't registered anywhere currently, so the user has to do that manually.
                
> Add JodaTime DateTime support
> -----------------------------
>
>                 Key: CAY-1626
>                 URL: https://issues.apache.org/jira/browse/CAY-1626
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Database integration
>    Affects Versions: 3.1M2
>            Reporter: Marc O'Morain
>         Attachments: DateTimeType.java, joda-patch.txt
>
>
> Here is some code that we wrote at Swrve to load/save jodatime DateTime objects with Cayenne

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAY-1626) Add JodaTime DateTime support

Posted by "Marc O'Morain (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1626?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marc O'Morain updated CAY-1626:
-------------------------------

    Attachment: DateTimeType.java
    
> Add JodaTime DateTime support
> -----------------------------
>
>                 Key: CAY-1626
>                 URL: https://issues.apache.org/jira/browse/CAY-1626
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Database integration
>    Affects Versions: 3.1M2
>            Reporter: Marc O'Morain
>         Attachments: DateTimeType.java
>
>
> Here is some code that we wrote at Swrve to load/save jodatime DateTime objects with Cayenne

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAY-1626) Add JodaTime DateTime support

Posted by "John Huss (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1626?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Huss updated CAY-1626:
---------------------------

    Attachment:     (was: joda-patch.txt)
    
> Add JodaTime DateTime support
> -----------------------------
>
>                 Key: CAY-1626
>                 URL: https://issues.apache.org/jira/browse/CAY-1626
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Database integration
>    Affects Versions: 3.1M2
>            Reporter: Marc O'Morain
>         Attachments: DateTimeType.java, joda-patch.txt
>
>
> Here is some code that we wrote at Swrve to load/save jodatime DateTime objects with Cayenne

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAY-1626) Add JodaTime DateTime support

Posted by "John Huss (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1626?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Huss updated CAY-1626:
---------------------------

    Attachment: joda-patch.txt

Updated patch with some bug fixes
                
> Add JodaTime DateTime support
> -----------------------------
>
>                 Key: CAY-1626
>                 URL: https://issues.apache.org/jira/browse/CAY-1626
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Database integration
>    Affects Versions: 3.1M2
>            Reporter: Marc O'Morain
>         Attachments: DateTimeType.java, joda-patch.txt
>
>
> Here is some code that we wrote at Swrve to load/save jodatime DateTime objects with Cayenne

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAY-1626) Add JodaTime DateTime support

Posted by "John Huss (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1626?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Huss updated CAY-1626:
---------------------------

    Comment: was deleted

(was: I'm trying to use this with Postgresql and it's not working.  Are you defining the column as a varchar or as a timestamp?  With postgres it doesn't like you using statement.setString to set a timestamp field.  And for reading the value, it doesn't parse because the timezone offset is appended to the string returned by rs.getString; and even without that, that string only contains the value down to the second, omitting the milliseconds.)
    
> Add JodaTime DateTime support
> -----------------------------
>
>                 Key: CAY-1626
>                 URL: https://issues.apache.org/jira/browse/CAY-1626
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Database integration
>    Affects Versions: 3.1M2
>            Reporter: Marc O'Morain
>         Attachments: DateTimeType.java
>
>
> Here is some code that we wrote at Swrve to load/save jodatime DateTime objects with Cayenne

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAY-1626) Add JodaTime DateTime support

Posted by "John Huss (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13133140#comment-13133140 ] 

John Huss commented on CAY-1626:
--------------------------------

I'm trying to use this with Postgresql and it's not working.  Are you defining the column as a varchar or as a timestamp?  With postgres it doesn't like you using statement.setString to set a timestamp field.  And for reading the value, it doesn't parse because the timezone offset is appended to the string returned by rs.getString; and even without that, that string only contains the value down to the second, omitting the milliseconds.
                
> Add JodaTime DateTime support
> -----------------------------
>
>                 Key: CAY-1626
>                 URL: https://issues.apache.org/jira/browse/CAY-1626
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Database integration
>    Affects Versions: 3.1M2
>            Reporter: Marc O'Morain
>         Attachments: DateTimeType.java
>
>
> Here is some code that we wrote at Swrve to load/save jodatime DateTime objects with Cayenne

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira