OpenJPA
  1. OpenJPA
  2. OPENJPA-1100

@Version-Annotation on Column with unsupported type (e.g. BigDecimal) is silently ignored, but should raise an error

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.1, 1.3.0, 2.0.0-M2
    • Fix Version/s: 2.0.0-M3
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows XP, Java SDK 1.6, Websphere 6.1 + openJPA 1.2.1

      Description

      In the following example, the @Version annotated field 'version' does have a wrong type (none of the supported ones).

      @Entity
      @Table(name = "PARTNER", schema = "PART")
      public class Partner

      { @Id @Column(name = "PART_KEY") private BigDecimal partKey; @OneToMany(mappedBy = "partner", fetch = FetchType.LAZY) private List<PartnerRolle> rollen; }

      @Entity
      @Table(name = "PARTNERROLLE")
      public class PartnerRolle

      { @EmbeddedId private PartnerRolleKey key; @Version @Column(name = "VERSION") private BigDecimal version; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "PART_KEY") private Partner partner; }

      This does NOT lead to an error but silently omits the column in any query statements. The prepared statement (prepstmt) simply omitts the column. If the @Version is removed or a supported type like 'long' is used, the behaviour is correct.

      Best regards,

      Heiko

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        97d 12h 27m 1 Pinaki Poddar 28/Aug/09 01:40
        Resolved Resolved Closed Closed
        193d 16h 51m 1 Donald Woods 09/Mar/10 18:31
        Donald Woods made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Donald Woods made changes -
        Fix Version/s 2.0.0 [ 12314019 ]
        Fix Version/s 2.0.0-M4 [ 12314149 ]
        Affects Version/s 2.0.0-M2 [ 12313483 ]
        Affects Version/s 1.3.0 [ 12313326 ]
        Pinaki Poddar made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0.0-M3 [ 12314148 ]
        Fix Version/s 2.0.0-M4 [ 12314149 ]
        Fix Version/s 2.0.0 [ 12314019 ]
        Resolution Fixed [ 1 ]
        Pinaki Poddar made changes -
        Field Original Value New Value
        Assignee Pinaki Poddar [ ppoddar@apache.org ]
        Heiko Kopp created issue -

          People

          • Assignee:
            Pinaki Poddar
            Reporter:
            Heiko Kopp
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development