Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
33 | PointedEar | 1 | /* $Id: PersistenceUnit.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 EntityManagerFactory. |
||
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 PersistenceUnit { |
||
22 | /** |
||
23 | * The name by which the entity manager factory is to be accessed in the environment |
||
24 | * referencing context, and is not needed when dependency injection is used. |
||
25 | */ |
||
26 | String name() default ""; |
||
27 | /** |
||
28 | * The name of the persistence unit as defined in the persistence.xml file. If specified, the |
||
29 | * persistence unit for the entity manager factory that is accessible in JNDI must have the |
||
30 | * same name. |
||
31 | */ |
||
32 | String unitName() default ""; |
||
33 | } |