[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4666) Implement the clarified rules for resource discovery (esp for <mapping-file> and co)

Emmanuel Bernard (JIRA) noreply at atlassian.com
Thu Dec 10 11:55:09 EST 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=34923#action_34923 ] 

Emmanuel Bernard commented on HHH-4666:
---------------------------------------

See also section 8.2.2
An EJB-JAR, WAR, application client jar, or EAR can define a persistence unit.
When referencing a persistence unit using the unitName annotation element or persis- tence-unit-name deployment descriptor element, the visibility scope of the persistence unit is determined by its point of definition:
•
•
A persistence unit that is defined at the level of an EJB-JAR, WAR, or application client jar is scoped to that EJB-JAR, WAR, or application jar respectively and is visible to the components defined in that jar or war.
A persistence unit that is defined at the level of the EAR is generally visible to all components in the application. However, if a persistence unit of the same name is defined by an EJB-JAR, WAR, or application jar file within the EAR, the persistence unit of that name defined at EAR level will not be visible to the components defined by that EJB-JAR, WAR, or application jar file unless the persistence unit reference uses the persistence unit name # syntax to specify a path name to disambiguate the reference. When the # syntax is used, the path name is relative to the referencing application component jar file. For example, the syntax ../lib/persis- tenceUnitRoot.jar#myPersistenceUnit refers to a persistence unit whose name, as specified in the name element of the persistence.xml file, is myPersistenceUnit and for which the relative path name of the root of the persistence unit is ../lib/persis- tenceUnitRoot.jar. The # syntax may be used with both the unitName annotation ele- ment or persistence-unit-name deployment descriptor element to reference a persistence unit defined at EAR level.


> Implement the clarified rules for resource discovery (esp for <mapping-file> and co)
> ------------------------------------------------------------------------------------
>
>                 Key: HHH-4666
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4666
>             Project: Hibernate Core
>          Issue Type: Sub-task
>          Components: entity-manager
>            Reporter: Emmanuel Bernard
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the hibernate-issues mailing list