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.