Subversion Repositories WebE

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
33 PointedEar 1
/* $Id: PersistenceContext.java 11282 2007-03-14 22:05:59Z epbernard $
2
 * JBoss Inc
3
 *
4
 * Distributable under LGPL license.
5
 * See terms of license at gnu.org.
6
 */
7
package javax.persistence;
8
 
9
import java.lang.annotation.ElementType;
10
import java.lang.annotation.Retention;
11
import java.lang.annotation.RetentionPolicy;
12
import java.lang.annotation.Target;
13
 
14
/**
15
 * Expresses a dependency on an EntityManager persistence context.
16
 *
17
 * @author <a href="mailto:bill@jboss.org">Bill Burke</a>
18
 */
19
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})
20
@Retention(RetentionPolicy.RUNTIME)
21
public @interface PersistenceContext {
22
        /**
23
         * The name by which the entity manager is to be accessed in the environment referencing context,
24
         * and is not needed when dependency injection is used.
25
         */
26
        String name() default "";
27
        /**
28
         * The name of the persistence unit. If the unitName element is specified, the persistence unit
29
         * for the entity manager that is accessible in JNDI must have the same name.
30
         */
31
        String unitName() default "";
32
        /**
33
         * Used to specify properties for the container or persistence provider. Vendor specific
34
         * properties may be included in this set of properties. Properties that are not
35
         * recognized by a vendor are ignored.
36
         */
37
        PersistenceProperty[] properties() default {};
38
        /**
39
         * Specifies whether this is a transaction-scoped persistence context or
40
         * an extended persistence context.
41
         */
42
        PersistenceContextType type() default PersistenceContextType.TRANSACTION;
43
}