users@jpa-spec.java.net

[jpa-spec users] Re: Section 8.2.1.6.2 clarification?

From: Linda DeMichiel <linda.demichiel_at_oracle.com>
Date: Thu, 13 Dec 2012 13:24:38 -0800

On 12/13/2012 1:11 PM, Laird Nelson wrote:
> Section 8.2.1.6.2 of the JPA 2.0 specification (page 314) talks about entity mapping files (orm.xml and its ilk).
>
> I am trying to understand whether the spec calls for META-INF/orm.xml to /always/ be processed, or /only/ when one of
> the following is true:
>
> 1. META-INF/orm.xml is explicitly included in persistence.xml as a mapping-file element
> 2. META-INF/orm.xml is not mentioned anywhere in persistence.xml
>
> Specifically, the wording that confused me was this:
>
> A [sic] object/relational mapping XML file named orm.xml may be specified 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. /Alternatively,
> or in addition/, one or more mapping files may be referenced by the mapping-file elements of the persistence-unit
> element.
>
>
> "Alternatively, or in addition" doesn't seem to tell me whether--if I specify mapping-file elements that do not include
> "META-INF/orm.xml"--the META-INF/orm.xml mapping file will nevertheless be processed in addition to any that I
> referenced explicitly.
>

Yes, it will be. I thought the paragraph following the one you cite made this clear, but will have another look.

regards,

-Linda


> My apologies in advance if I'm simply misreading or misinterpreting something here.
>
> Thanks,
> Laird
>
> --
> http://about.me/lairdnelson
>