Hitachi

uCosminexus Application Server Compatibility Guide


9.22.1 Annotations that depend on the JPA Provider

This point describes the applicability of the annotations that depend on the JPA Provider. The annotations that can be coded in each component are as follows:

Organization of this subsection

(1) WAR file (Servlet 3.0 compliant)

The following table lists the annotations that you can code in a WAR file:

Table 9‒30: Annotations (javax. persistence package) that can be coded in WAR file (Servlet 3.0 compliant)

Annotation name

Servlet specifications

JSP specifications

Exception class

ManagedBean (JSF)

Other class

Servlet

Servlet (API)

Servlet filter

Servlet filter (API)

Event listener

Event listener (API)

JSP FILE

Tag handler

Tag library event listener

Classic tag handler

Simple tag handler

@PersistenceContext

Y

--

Y

--

Y

--

--

Y

Y

N

--

Y

--

@PersistenceContexts

Y

--

Y

--

Y

--

--

Y

Y

N

--

Y

--

@PersistenceProperty

Y

--

Y

--

Y

--

--

Y

Y

N

--

Y

--

@PersistenceUnit

Y

--

Y

--

Y

--

--

Y

Y

N

--

Y

--

@PersistenceUnits

Y

--

Y

--

Y

--

--

Y

Y

N

--

Y

--

Legend:

Y: Supported.

N: Not supported by Application Server.

--: Not supported by standard specifications.

(2) WAR file (Supported by Servlet 2.5)

The following table lists the annotations that you can code in a WAR file:

Table 9‒31: Annotations (javax.persistence package) that can be coded in a WAR file (Supported by Servlet 2.5)

Annotation name

Servlet specifications

JSP specifications

Other class

Servlet

Servlet filter

Event listener

JSP file

Tag handler

Tag library event listener

Classic tag handler

Simple tag handler

@PersistenceContext

Y

Y

Y

--

Y

Y

N

--

@PersistenceContexts

Y

Y

Y

--

Y

Y

N

--

@PersistenceProperty

Y

Y

Y

--

Y

Y

N

--

@PersistenceUnit

Y

Y

Y

--

Y

Y

N

--

@PersistenceUnits

Y

Y

Y

--

Y

Y

N

--

Legend:

Y: Supported.

N: Not supported by Application Server.

--: Not applicable.

(3) EJB-JAR file (EJB3.1/EJB3.0 compliant)

The following table lists the annotations that you can code in an EJB-JAR file:

Table 9‒32: Annotations (javax.persistence package) that can be coded in an EJB-JAR file (Supported by EJB3.0)

Annotation name

Enterprise Bean

Exception class

Other class

Interface

Session Bean

Entity Bean

Message-driven Bean

Interceptor

Other than default Interceptor

Default Interceptor

@PersistenceContext

--

Y

--

N

Y

Y

--

--

@PersistenceContexts

--

Y

--

N

Y

Y

--

--

@PersistenceProperty

--

Y

--

N

Y

Y

--

--

@PersistenceUnit

--

Y

--

N

Y

Y

--

--

@PersistenceUnits

--

Y

--

N

Y

Y

--

--

Legend:

Y: Supported.

N: Not supported by Application Server.

--: Not applicable.

(4) Library JAR file (Servlets or JSPs)

The following table lists the annotations that you can code in a servlet or JSP of a library JAR file.

Table 9‒33: Annotations (javax.persistence package) that can be coded in a library JAR file (Servlets or JSPs)

Annotation name

Servlet specifications

JSP specifications

Servlet

Servlet (API)

Servlet filter

Servlet filter (API)

Event listener

Event listener (API)

JSP FILE

Tag handler

Tag library event listener

Classic tag handler

Simple tag handler

@PersistenceContext

--

--

Y

--

Y

--

--

Y

Y

N

@PersistenceContexts

--

--

Y

--

Y

--

--

Y

Y

N

@PersistenceProperty

--

--

Y

--

Y

--

--

Y

Y

N

@PersistenceUnit

--

--

Y

--

Y

--

--

Y

Y

N

@PersistenceUnits

--

--

Y

--

Y

--

--

Y

Y

N

Legend:

Y: Supported.

N: Not supported by Application Server.

--: Not applicable.

(5) Library JAR file (Enterprise Bean, exception class, or other classes)

The following table lists the annotations that you can code in the Enterprise Beans, exception classes, or the other classes of a library JAR file:

Table 9‒34: Annotations (javax.persistence package) that can be coded in a library JAR file (Enterprise Beans, exception classes, or other classes)

Annotation name

Enterprise Bean

Exception class

Interface

Session Bean

Entity Bean

Message-driven Bean

Interceptor

@PersistenceContext

--

--

--

N

Y

--

@PersistenceContexts

--

--

--

N

Y

--

@PersistenceProperty

--

--

--

N

Y

--

@PersistenceUnit

--

--

--

N

Y

--

@PersistenceUnits

--

--

--

N

Y

--

Legend:

Y: Supported.

N: Not supported by Application Server.

--: Not applicable.