javaee:persistence-context-refType

The persistence-context-ref element contains a declaration
	  of Deployment Component's reference to a persistence context
	  associated within a Deployment Component's
	  environment. It consists of:

		  - an optional description
		  - the persistence context reference name
		  - an optional persistence unit name.  If not specified,
                    the default persistence unit is assumed.
		  - an optional specification as to whether
		    the persistence context type is Transaction or
		    Extended.  If not specified, Transaction is assumed.
                  - an optional list of persistence properties
		  - optional injection targets

	  Examples:

            <persistence-context-ref>
              <persistence-context-ref-name>myPersistenceContext
              </persistence-context-ref-name>
            </persistence-context-ref>

            <persistence-context-ref>
              <persistence-context-ref-name>myPersistenceContext
                </persistence-context-ref-name>
              <persistence-unit-name>PersistenceUnit1
                </persistence-unit-name>
              <persistence-context-type>Extended</persistence-context-type>
            </persistence-context-ref>

Complex Type Information

Model

Attributes

QName Type Fixed Default Use Inheritable Annotation
id xsd:ID optional

Used By

Source

<xsd:complexType name="persistence-context-refType">
  <xsd:annotation>
    <xsd:documentation>
      <![CDATA[

	  The persistence-context-ref element contains a declaration
	  of Deployment Component's reference to a persistence context
	  associated within a Deployment Component's
	  environment. It consists of:

		  - an optional description
		  - the persistence context reference name
		  - an optional persistence unit name.  If not specified,
                    the default persistence unit is assumed.
		  - an optional specification as to whether
		    the persistence context type is Transaction or
		    Extended.  If not specified, Transaction is assumed.
                  - an optional list of persistence properties
		  - optional injection targets

	  Examples:

            <persistence-context-ref>
              <persistence-context-ref-name>myPersistenceContext
              </persistence-context-ref-name>
            </persistence-context-ref>

            <persistence-context-ref>
              <persistence-context-ref-name>myPersistenceContext
                </persistence-context-ref-name>
              <persistence-unit-name>PersistenceUnit1
                </persistence-unit-name>
              <persistence-context-type>Extended</persistence-context-type>
            </persistence-context-ref>

	  ]]>
    </xsd:documentation>
  </xsd:annotation>
  <xsd:sequence>
    <xsd:element name="description" type="javaee:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element name="persistence-context-ref-name" type="javaee:jndi-nameType">
      <xsd:annotation>
        <xsd:documentation>The persistence-context-ref-name element specifies the name of a persistence context reference; its value is the environment entry name used in Deployment Component code. The name is a JNDI name relative to the java:comp/env context.</xsd:documentation>
      </xsd:annotation>
    </xsd:element>
    <xsd:element name="persistence-unit-name" type="javaee:string" minOccurs="0">
      <xsd:annotation>
        <xsd:documentation>The Application Assembler(or BeanProvider) may use the following syntax to avoid the need to rename persistence units to have unique names within a Java EE application. The Application Assembler specifies the pathname of the root of the persistence.xml file for the referenced persistence unit and appends the name of the persistence unit separated from the pathname by #. The pathname is relative to the referencing application component jar file. In this manner, multiple persistence units with the same persistence unit name may be uniquely identified when the Application Assembler cannot change persistence unit names.</xsd:documentation>
      </xsd:annotation>
    </xsd:element>
    <xsd:element name="persistence-context-type" type="javaee:persistence-context-typeType" minOccurs="0"/>
    <xsd:element name="persistence-property" type="javaee:propertyType" minOccurs="0" maxOccurs="unbounded">
      <xsd:annotation>
        <xsd:documentation>Used to specify properties for the container or persistence provider. Vendor-specific properties may be included in the set of properties. Properties that are not recognized by a vendor must be ignored. Entries that make use of the namespace javax.persistence and its subnamespaces must not be used for vendor-specific properties. The namespace javax.persistence is reserved for use by the specification.</xsd:documentation>
      </xsd:annotation>
    </xsd:element>
    <xsd:group ref="javaee:resourceGroup"/>
  </xsd:sequence>
  <xsd:attribute name="id" type="xsd:ID"/>
</xsd:complexType>