View Javadoc

1   package com.bm.ejb3metadata.annotations.impl;
2   
3   import javax.persistence.PersistenceContextType;
4   
5   /**
6    * This class allow to set informations on javax.persistence.PersistenceContext
7    * annotation.
8    * @author Daniel Wiese
9    */
10  public class JavaxPersistenceContext {
11  
12      /**
13       * Name of this persistence context.
14       */
15      private String name = null;
16  
17      /**
18       * Unit name of this persistence context.
19       */
20      private String unitName = null;
21  
22      /**
23       * Type of persistence context.
24       */
25      private PersistenceContextType type = null;
26  
27      /**
28       * Build new object with default values.
29       */
30      public JavaxPersistenceContext() {
31          // default values
32          this.name = "";
33          this.unitName = "";
34          this.type = PersistenceContextType.TRANSACTION;
35      }
36  
37      /**
38       * @return the type of persistence context.
39       */
40      public PersistenceContextType getType() {
41          return type;
42      }
43  
44      /**
45       * Sets the persistence context type.
46       * @param type given type.
47       */
48      public void setType(final PersistenceContextType type) {
49          this.type = type;
50      }
51  
52      /**
53       * @return the unit name used by this persistence context.
54       */
55      public String getUnitName() {
56          return unitName;
57      }
58  
59      /**
60       * sets the unit name of this persistence context.
61       * @param unitName the name of the persistence unit
62       */
63      public void setUnitName(final String unitName) {
64          this.unitName = unitName;
65      }
66  
67      /**
68       * @return the unit name used by this persistence context.
69       */
70      public String getName() {
71          return name;
72      }
73  
74      /**
75       * sets the name of this persistence context.
76       * @param name the name of the persistence context
77       */
78      public void setName(final String name) {
79          this.name = name;
80      }
81  
82  }