glassfish
  1. glassfish
  2. GLASSFISH-1438

should an empty <id> xml mapping override the annotations on an id field/property

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 9.1pe
    • Fix Version/s: not determined
    • Component/s: entity-persistence
    • Labels:
      None
    • Environment:

      Operating System: Linux
      Platform: Linux

    • Issuezilla Id:
      1,438

      Description

      Glassfish V2 Build 24.

      As per Section 10.1.3.22:
      "The id subelement [of <entity><attributes></attributes></entity>] overrides the
      mapping for the specified field or property."

      Now, consider the scenario where an Entity class E1 exists with @GeneratedValue
      and @TableGenerator annotations on its id field and has the following mapping in
      the orm.xml
      <entity class="E1">
      <attributes>
      <id name="identifier" />
      </attributes>
      </entity>
      (Note that NO other mapping elements are defined in the orm.xml under <id>;
      options do exist to define <generated-value>, <table-generator> etc under <id>)

      Current Result: The @GeneratedValue and the @TableGenerator annotations apply on
      the id field and are not overridden by the empty children of <id>.

      It seems that different persistence providers could decide to either apply the
      annotations or have the above <id> mapping override the annotations such that no
      mappings apply to the id field. This can make this feature non-portable?

      The behaviour of this scenario can be determined after the spec clearly defines it.

        Activity

        Hide
        vr143562 added a comment -

        corrected typo in "Summary" - changed filed to field

        Show
        vr143562 added a comment - corrected typo in "Summary" - changed filed to field
        Hide
        marina vatkina added a comment -

        resetting the default owner

        Show
        marina vatkina added a comment - resetting the default owner
        Hide
        Tom Mueller added a comment -

        Bulk change to set fix version to "not determined" where the issue is open but the value is for a released version.

        Show
        Tom Mueller added a comment - Bulk change to set fix version to "not determined" where the issue is open but the value is for a released version.

          People

          • Assignee:
            tware
            Reporter:
            vr143562
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: