1. glassfish
  2. GLASSFISH-1437

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


    • 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:
    • Environment:

      Operating System: Linux
      Platform: Linux

    • Issuezilla Id:


      Glassfish V2 Build 24.

      As per Section
      "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, and 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.


        vr143562 created issue -
        kenaiadmin made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 1437 33041
        Tom Mueller made changes -
        Fix Version/s not determined [ 11149 ]
        Fix Version/s 9.1pe [ 10974 ]


          • Assignee:
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: