On Thu, Dec 13, 2012 at 1:24 PM, Linda DeMichiel <linda.demichiel_at_oracle.com
> wrote:
> Yes, it will be. I thought the paragraph following the one you cite made
> this clear, but will have another look.
>
OK. For the purposes of feedback, here's my "close reading" :-) of the
following paragraph:
An orm.xml mapping file *or other mapping file* is loaded as a resource by
> the persistence provider.
"or other mapping file" led me to believe here that there was an implicit
"...following the rules just laid out in the paragraph above", which
doesn't really say whether orm.xml is always loaded. For example, if I had
a mapping-file element with "BOGUS-INF/fred.xml", then I was assuming that
this mapping file ("...or other mapping file...") was the one under
discussion. If I didn't have one, then I would assume that "
META-INF/orm.xml" is the one under discussion.
Anyhow with your comment saying that a mapping file whose resource name is
META-INF/orm.xml is *always* loaded in all cases (if it is physically
present, obviously) suggests that maybe this section should read something
like this (in part):
An object/relational mapping XML file contains mapping information for the
classes listed in it.
A object/relational mapping XML file named orm.xml may be placed in
the META-INF
directory in the root of the persistence unit or in the META-INF directory
of any jar file referenced by the persistence.xml. If it exists, then the
classes and mapping information specified in it will be used as described
in Chapter 12. (deleted "Alternatively, or in ")In addition, one or more
supplemental mapping files may be referenced by the mapping-file elements
of the persistence-unit element. These mapping files may be present
anywhere on the class path.
An orm.xml mapping file or other mapping file is loaded as a resource by
the persistence provider. If a supplemental mapping file is specified, the
classes and mapping information specified in the mapping file will be used
as described in Chapter 12. If multiple supplemental mapping files are
specified (possibly including one or more orm.xml files), the resulting
mappings are obtained by combining the mappings from all of the files. The
result is undefined if multiple mapping files (including any orm.xml file)
referenced within a single persistence unit contain overlapping mapping
information for any given class. The object/relational mapping information
contained in any mapping file referenced within the persistence unit must
be disjoint at the class-level from object/relational mapping information
contained in any other such mapping file.
Hope that helps.
> If a mapping file is specified, the classes and mapping information
> specified in the mapping file will be used as described in Chapter 12.
Straightforward.
> If multiple mapping files are specified (possibly including one or more orm.xml
> files), the resulting mappings are obtained by combining the mappings from
> all of the files. The result is undefined if multiple mapping files
> (including any orm.xml file) referenced within a sin- gle persistence
> unit contain overlapping mapping information for any given class. The
> object/relational mapping information contained in any mapping file
> referenced within the persistence unit must be dis- joint at the
> class-level from object/relational mapping information contained in any
> other such mapping file.
i.e. don't spell out your mappings twice. Also straightforward.
So it's the first sentence of that following paragraph that is actually the
ambiguous one. But now I know; thanks!
Best,
Laird
--
http://about.me/lairdnelson