Farrukh Najmi wrote:
> Sahoo wrote:
>> Entity listener information can be supplied in O/R mapping XML file
>> like orm.xml. You can have a provision for a mapping file in your
>> persistence.xml file by adding a <mapping-file> entry in
>> persistence.xml of base-project.jar. You can populate the content of
>> that mapping file as per your need and install it in classpath. If
>> you don't want any listeners, just install a valid, empty mapping
>> file. Again, take a look at the spec for more details about mapping
>> file.
>
> I need one more clarification on this...
>
> The spec says:
>
> "
> Example 2:
>
> <persistence-unit name="OrderManagement2">
> <mapping-file>mappings.xml</mapping-file>
> </persistence-unit>
>
> A persistence unit named OrderManagement2 is created. Any annotated
> managed persistence
> classes found in the root of the persistence unit are added to the
> list of managed persistence classes. The
> mappings.xml resource exists on the classpath and any classes and
> mapping information contained
> in it are used as specified above. *If a META-INF/orm.xml file
> exists*, any classes and mapping infor-
> mation contained in it are used as well. The transaction type, data
> source, and provider are as described
> above.
> "
>
> Above implies that I do not need to explicitly reference the orm.xml
> file using mapping-file if it is in the right place. Am I correct in
> my interpretation?
>
> If so, where does the META-INF/orm.xml file have to exist?
> Can if be in any jar or classpath directory (not reference via
> <jar-file> tag in persistence.xml)?
>
> Thanks again for your kind help.
>
Also what if multiple META-INF/orm.xml files are found in the jars /
classpath?
What are the semantics for that?
--
Regards,
Farrukh
Web: http://www.wellfleetsoftware.com