001: /**
002: * EasyBeans
003: * Copyright (C) 2006 Bull S.A.S.
004: * Contact: easybeans@ow2.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: JavaxPersistenceContext.java 2067 2007-11-27 10:03:12Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.deployment.annotations.impl;
025:
026: import javax.persistence.PersistenceContextType;
027:
028: import org.ow2.easybeans.deployment.api.IJavaxPersistenceContext;
029:
030: /**
031: * This class allow to set informations on javax.persistence.PersistenceContext
032: * annotation.
033: * @author Florent Benoit
034: */
035: public class JavaxPersistenceContext implements
036: IJavaxPersistenceContext {
037:
038: /**
039: * Name of this persistence context.
040: */
041: private String name = null;
042:
043: /**
044: * Unit name of this persistence context.
045: */
046: private String unitName = null;
047:
048: /**
049: * Type of persistence context.
050: */
051: private PersistenceContextType type = null;
052:
053: /**
054: * Build new object with default values.
055: */
056: public JavaxPersistenceContext() {
057: // default values
058: this .name = "";
059: this .unitName = "";
060: this .type = PersistenceContextType.TRANSACTION;
061: }
062:
063: /**
064: * @return the type of persistence context.
065: */
066: public PersistenceContextType getType() {
067: return type;
068: }
069:
070: /**
071: * Sets the persistence context type.
072: * @param type given type.
073: */
074: public void setType(final PersistenceContextType type) {
075: this .type = type;
076: }
077:
078: /**
079: * @return the unit name used by this persistence context.
080: */
081: public String getUnitName() {
082: return unitName;
083: }
084:
085: /**
086: * sets the unit name of this persistence context.
087: * @param unitName the name of the persistence unit
088: */
089: public void setUnitName(final String unitName) {
090: this .unitName = unitName;
091: }
092:
093: /**
094: * @return the unit name used by this persistence context.
095: */
096: public String getName() {
097: return name;
098: }
099:
100: /**
101: * sets the name of this persistence context.
102: * @param name the name of the persistence context
103: */
104: public void setName(final String name) {
105: this.name = name;
106: }
107:
108: }
|