KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > deployment > annotations > impl > JavaxPersistenceContext


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: JavaxPersistenceContext.java 378 2006-04-21 08:23:04Z benoitf $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.easybeans.deployment.annotations.impl;
27
28 import javax.persistence.PersistenceContextType;
29
30 /**
31  * This class allow to set informations on javax.persistence.PersistenceContext
32  * annotation.
33  * @author Florent Benoit
34  */

35 public class JavaxPersistenceContext {
36
37     /**
38      * Name of this persistence context.
39      */

40     private String JavaDoc name = null;
41
42     /**
43      * Unit name of this persistence context.
44      */

45     private String JavaDoc unitName = null;
46
47     /**
48      * Type of persistence context.
49      */

50     private PersistenceContextType type = null;
51
52     /**
53      * Build new object with default values.
54      */

55     public JavaxPersistenceContext() {
56         // default values
57
this.name = "";
58         this.unitName = "";
59         this.type = PersistenceContextType.TRANSACTION;
60     }
61
62     /**
63      * @return the type of persistence context.
64      */

65     public PersistenceContextType getType() {
66         return type;
67     }
68
69     /**
70      * Sets the persistence context type.
71      * @param type given type.
72      */

73     public void setType(final PersistenceContextType type) {
74         this.type = type;
75     }
76
77     /**
78      * @return the unit name used by this persistence context.
79      */

80     public String JavaDoc getUnitName() {
81         return unitName;
82     }
83
84     /**
85      * sets the unit name of this persistence context.
86      * @param unitName the name of the persistence unit
87      */

88     public void setUnitName(final String JavaDoc unitName) {
89         this.unitName = unitName;
90     }
91
92     /**
93      * @return the unit name used by this persistence context.
94      */

95     public String JavaDoc getName() {
96         return name;
97     }
98
99     /**
100      * sets the name of this persistence context.
101      * @param name the name of the persistence context
102      */

103     public void setName(final String JavaDoc name) {
104         this.name = name;
105     }
106
107 }
108
Popular Tags