001: /*
002: * Copyright (c) 1998-2008 Caucho Technology -- all rights reserved
003: *
004: * This file is part of Resin(R) Open Source
005: *
006: * Each copy or derived work must preserve the copyright notice and this
007: * notice unmodified.
008: *
009: * Resin Open Source is free software; you can redistribute it and/or modify
010: * it under the terms of the GNU General Public License as published by
011: * the Free Software Foundation; either version 2 of the License, or
012: * (at your option) any later version.
013: *
014: * Resin Open Source is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017: * of NON-INFRINGEMENT. See the GNU General Public License for more
018: * details.
019: *
020: * You should have received a copy of the GNU General Public License
021: * along with Resin Open Source; if not, write to the
022: *
023: * Free Software Foundation, Inc.
024: * 59 Temple Place, Suite 330
025: * Boston, MA 02111-1307 USA
026: *
027: * @author Rodrigo Westrupp
028: */
029:
030: package com.caucho.amber.cfg;
031:
032: import javax.persistence.EnumType;
033: import javax.persistence.FetchType;
034: import javax.persistence.TemporalType;
035:
036: /**
037: * <basic> tag in the orm.xml
038: */
039: public class BasicConfig {
040:
041: // attributes
042: private String _name;
043: private FetchType _fetch;
044: private boolean _optional;
045:
046: // elements
047: private ColumnConfig _column;
048: // XXX: lob type?
049: private String _lob;
050: private TemporalType _temporal;
051: private EnumType _enumerated;
052:
053: /**
054: * Returns the name.
055: */
056: public String getName() {
057: return _name;
058: }
059:
060: /**
061: * Sets the name.
062: */
063: public void setName(String name) {
064: _name = name;
065: }
066:
067: /**
068: * Returns the fetch type.
069: */
070: public FetchType getFetch() {
071: return _fetch;
072: }
073:
074: /**
075: * Sets the fetch type.
076: */
077: public void setFetch(String fetch) {
078: _fetch = FetchType.valueOf(fetch);
079: }
080:
081: /**
082: * Returns the optional.
083: */
084: public boolean getOptional() {
085: return _optional;
086: }
087:
088: /**
089: * Sets the optional.
090: */
091: public void setOptional(boolean optional) {
092: _optional = optional;
093: }
094:
095: /**
096: * Returns the column.
097: */
098: public ColumnConfig getColumn() {
099: return _column;
100: }
101:
102: /**
103: * Sets the column.
104: */
105: public void setColumn(ColumnConfig column) {
106: _column = column;
107: }
108:
109: /**
110: * Returns the lob.
111: */
112: public String getLob() {
113: return _lob;
114: }
115:
116: /**
117: * Sets the lob.
118: */
119: public void setLob(String lob) {
120: _lob = lob;
121: }
122:
123: /**
124: * Returns the temporal.
125: */
126: public TemporalType getTemporal() {
127: return _temporal;
128: }
129:
130: /**
131: * Sets the temporal.
132: */
133: public void setTemporal(String temporal) {
134: _temporal = TemporalType.valueOf(temporal);
135: }
136:
137: /**
138: * Returns the enumerated.
139: */
140: public EnumType getEnumerated() {
141: return _enumerated;
142: }
143:
144: /**
145: * Sets the enumerated.
146: */
147: public void setEnumerated(String enumerated) {
148: _enumerated = EnumType.valueOf(enumerated);
149: }
150: }
|