castor
  1. castor
  2. CASTOR-1276

Need a method for forcing the timezone for dates written to the database

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.9.1
    • Fix Version/s: 1.1.1
    • Component/s: JDO types
    • Labels:
      None
    • Number of attachments :
      9

      Description

      Castor has a method for forcing what timezone to read dates with. (See http://www.castor.org/types.html#SQL-Dates-and-Default-Timezone). The problem is that this setting has not effect on what you write to the database. So you don't have round-trip integrity of date, time and timestamp values.

      For example, if I set the timezone to be 'UTC' in the castor.properties. When I write a date to the database it will write it to the database as 'PDT' (my local timezone) cause this is what the JDBC driver defaults too. But when I read it back it will convert it to 'UTC' because castor is is only converting on reads. So my dates will be 8 hours off of what they should be. Anyway, not the clearest explanation...sorry. I've attached a modified SQLTypeInfos.java file that should address the issue.

      1. patch.c1276.20051202.txt
        1 kB
        Werner Guttmann
      2. patch.C1276.20051218.txt
        7 kB
        Werner Guttmann
      3. patch.C1276.20051218-002.txt
        34 kB
        Werner Guttmann
      4. patch.C1276.20051219.test.txt
        9 kB
        Werner Guttmann
      5. patch-C1276-20070130.txt
        11 kB
        Ralf Joachim
      6. patch-C1276-20070205.txt
        16 kB
        Ralf Joachim
      7. patch-C1276-20070307.txt
        33 kB
        Ralf Joachim
      8. SQLTypeInfos.java
        13 kB
        Brian Schlining
      9. TestTemplate.java
        10 kB
        Brian Schlining

        Issue Links

          Activity

            People

            • Assignee:
              Ralf Joachim
              Reporter:
              Brian Schlining
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: