Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Labels:
      None

      Description

      The JPA 2.1 specification currently indicates that Timestamp is the only supported temporal type for @Version properties:

      The following types are supported for version properties: int, Integer, short, Short, long, Long, Timestamp.

      I'd propose that additional temporal types are supported as well:

      java.util.Date, java.util.Calendar, java.sql.Date, java.sql.Time, java.sql.Timestamp

        Activity

        Hide
        shelleyb added a comment - - edited

        For reference, Hibernate already seems to support this, and as such, we had initially overlooked this jpa limitation and are already using @Version java.util.Calendar in our entities, and I have observed this usage elsewhere as well:

        https://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch05.html#mapping-declaration-timestamp

        Show
        shelleyb added a comment - - edited For reference, Hibernate already seems to support this, and as such, we had initially overlooked this jpa limitation and are already using @Version java.util.Calendar in our entities, and I have observed this usage elsewhere as well: https://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch05.html#mapping-declaration-timestamp

          People

          • Assignee:
            Unassigned
            Reporter:
            shelleyb
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: