[GLASSFISH-1437] <table-generator> defined under the <id> tag should probably override the @TableGenerator Annotation defined on an Entity Class. Created: 07/Nov/06  Updated: 06/Mar/12

Status: Open
Project: glassfish
Component/s: entity-persistence
Affects Version/s: 9.1pe
Fix Version/s: not determined

Type: Improvement Priority: Major
Reporter: vr143562 Assignee: tware
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: Linux
Platform: Linux

Attachments: Zip Archive tg-under-id-element-override-bug.zip    
Issuezilla Id: 1,437


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.

Comment by vr143562 [ 07/Nov/06 ]

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

Comment by vr143562 [ 12/Nov/06 ]

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



Comment by marina vatkina [ 12/Feb/07 ]

resetting the default owner

Comment by Tom Mueller [ 06/Mar/12 ]

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

Generated at Mon Feb 08 12:35:54 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.