001: /*
002: $Header: /cvsroot/xorm/xorm/src/org/xorm/util/jdoxml/JDOField.java,v 1.2 2003/06/12 05:09:51 wbiggs Exp $
003:
004: This file is part of XORM.
005:
006: XORM is free software; you can redistribute it and/or modify
007: it under the terms of the GNU General Public License as published by
008: the Free Software Foundation; either version 2 of the License, or
009: (at your option) any later version.
010:
011: XORM 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
014: GNU General Public License for more details.
015:
016: You should have received a copy of the GNU General Public License
017: along with XORM; if not, write to the Free Software
018: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
019: */
020: package org.xorm.util.jdoxml;
021:
022: import java.util.ArrayList;
023: import java.util.Collection;
024:
025: /**
026: * Represents a JDO XML field declaration.
027: */
028: public class JDOField {
029: private String name;
030: private Collection extensions = new ArrayList();
031: private JDONullValue nullValue;
032: private JDOPersistenceModifier persistenceModifier;
033: private Boolean defaultFetchGroup;
034: private Boolean embedded;
035: private boolean primaryKey = false;
036:
037: // Zero or one of the following three will be set
038: private JDOCollection collection;
039: private JDOMap map;
040: private JDOArray array;
041:
042: public String getName() {
043: return name;
044: }
045:
046: public void setName(String name) {
047: this .name = name;
048: }
049:
050: public Collection getExtensions() {
051: return extensions;
052: }
053:
054: public JDONullValue getNullValue() {
055: return nullValue;
056: }
057:
058: public void setNullValue(JDONullValue nullValue) {
059: this .nullValue = nullValue;
060: }
061:
062: public JDOPersistenceModifier getPersistenceModifier() {
063: return persistenceModifier;
064: }
065:
066: public void setPersistenceModifier(
067: JDOPersistenceModifier persistenceModifier) {
068: this .persistenceModifier = persistenceModifier;
069: }
070:
071: public Boolean isDefaultFetchGroup() {
072: return defaultFetchGroup;
073: }
074:
075: public void setDefaultFetchGroup(Boolean value) {
076: this .defaultFetchGroup = value;
077: }
078:
079: public Boolean isEmbedded() {
080: return embedded;
081: }
082:
083: public void setEmbedded(Boolean value) {
084: this .embedded = value;
085: }
086:
087: public boolean isPrimaryKey() {
088: return primaryKey;
089: }
090:
091: public void setPrimaryKey(boolean value) {
092: this .primaryKey = value;
093: }
094:
095: public JDOCollection getCollection() {
096: return collection;
097: }
098:
099: public void setCollection(JDOCollection collection) {
100: this .map = null;
101: this .array = null;
102: this .collection = collection;
103: }
104:
105: public JDOMap getMap() {
106: return map;
107: }
108:
109: public void setMap(JDOMap map) {
110: this .array = null;
111: this .collection = null;
112: this .map = map;
113: }
114:
115: public JDOArray getArray() {
116: return array;
117: }
118:
119: public void setArray(JDOArray array) {
120: this.map = null;
121: this.collection = null;
122: this.array = array;
123: }
124: }
|