glassfish
  1. glassfish
  2. GLASSFISH-1437

<table-generator> defined under the <id> tag should probably override the @TableGenerator Annotation defined on an Entity Class.

    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,437

      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."

      Please note that the overriding rules for the elements under the <id> subelement
      are not defined by the spec.

      TableGenerators are global to a persistence unit (as per sections 9.1.38,
      10.1.2.6 and 10.1.3.12). As a result, a table generator defined using
      <entity><attributes><id><table-generator> in a xml mapping file, can be used by
      other entities in the same persistence unit.

      Therefore, the provider must allow a table generator defined by using
      <entity><attributes><id><table-generator> to override a table generator of the
      same name defined by using the @TableGenerator Annotation on the Entity class
      (as opposed to the id field/property).

      This currently results in a Validation Exception that describes a conflict in
      Table Generator names between annotations and the xml mapping file.

      A test case is attached to this bug to illustrate this. To use the test, define
      a environment variable S1AS_HOME that points to glassfish installation dir. Run
      the test by invoking "ant se-java2db" from the command-line.

        Activity

        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.
        Hide
        marina vatkina added a comment -

        resetting the default owner

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

        This is a enhancement request and not a bug. Kindly read all references above to
        "must" as "should probably".

        thanks.

        varun.

        Show
        vr143562 added a comment - This is a enhancement request and not a bug. Kindly read all references above to "must" as "should probably". thanks. varun.
        Hide
        vr143562 added a comment -

        Created an attachment (id=573)
        unzip the test case and follow the instructions in the first description

        Show
        vr143562 added a comment - Created an attachment (id=573) unzip the test case and follow the instructions in the first description

          People

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

            Dates

            • Created:
              Updated: