001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */
019: package org.apache.openjpa.persistence.event.common.apps;
020:
021: import java.io.Serializable;
022: import java.math.BigDecimal;
023: import java.math.BigInteger;
024: import java.util.Date;
025: import java.util.HashSet;
026: import java.util.Locale;
027: import java.util.Set;
028: import javax.persistence.CascadeType;
029: import javax.persistence.Entity;
030: import javax.persistence.FetchType;
031: import javax.persistence.OneToOne;
032:
033: import org.apache.openjpa.persistence.PersistentCollection;
034:
035: /**
036: * Used in testing; should be enhanced.
037: */
038: @Entity
039: public class RuntimeTest1 implements Serializable {
040:
041: public static final String someStaticField = "someField";
042:
043: private byte byteField;
044: private boolean booleanField;
045: private char charField;
046: private double doubleField = 1.0;
047: private float floatField = 1.0f;
048: private int intField;
049: private long longField;
050: private short shortField;
051: private String stringField;
052: private BigInteger bigIntegerField;
053: private BigDecimal bigDecimalField;
054: private Date dateField;
055: private Locale localeField;
056: private Byte byteObjfield;
057: private Boolean booleanObjField;
058: private Character charObjField;
059: private Double doubleObjField;
060: private Float floatObjField = 1.0F;
061: private Integer intObjField;
062: private Long longObjField;
063: private Short shortObjField;
064:
065: // transactional only
066: private TransactionalClassPC transField;
067: public String transString;
068:
069: // relations
070: @OneToOne(fetch=FetchType.LAZY,cascade={CascadeType.ALL})
071: private RuntimeTest1 selfOneOne;
072: @PersistentCollection
073: private Set selfOneMany = new HashSet();
074:
075: public RuntimeTest1() {
076: }
077:
078: public RuntimeTest1(String str, int i) {
079: stringField = str;
080: intField = i;
081:
082: //FIXME Seetha Oct 25,2006
083: //mySQL 0.0 float issue
084: floatField = 1.0f;
085: }
086:
087: public byte getByteField() {
088: return this .byteField;
089: }
090:
091: public void setByteField(byte byteField) {
092: this .byteField = byteField;
093: }
094:
095: public boolean getBooleanField() {
096: return this .booleanField;
097: }
098:
099: public void setBooleanField(boolean booleanField) {
100: this .booleanField = booleanField;
101: }
102:
103: public char getCharField() {
104: return this .charField;
105: }
106:
107: public void setCharField(char charField) {
108: this .charField = charField;
109: }
110:
111: public double getDoubleField() {
112: return this .doubleField;
113: }
114:
115: public void setDoubleField(double doubleField) {
116: this .doubleField = doubleField;
117: }
118:
119: public float getFloatField() {
120: return this .floatField;
121: }
122:
123: public void setFloatField(float floatField) {
124: this .floatField = floatField;
125: }
126:
127: public int getIntField() {
128: return this .intField;
129: }
130:
131: public void setIntField(int intField) {
132: this .intField = intField;
133: }
134:
135: public long getLongField() {
136: return this .longField;
137: }
138:
139: public void setLongField(long longField) {
140: this .longField = longField;
141: }
142:
143: public short getShortField() {
144: return this .shortField;
145: }
146:
147: public void setShortField(short shortField) {
148: this .shortField = shortField;
149: }
150:
151: public String getStringField() {
152: return this .stringField;
153: }
154:
155: public void setStringField(String stringField) {
156: this .stringField = stringField;
157: }
158:
159: public BigInteger getBigIntegerField() {
160: return this .bigIntegerField;
161: }
162:
163: public void setBigIntegerField(BigInteger bigIntegerField) {
164: this .bigIntegerField = bigIntegerField;
165: }
166:
167: public BigDecimal getBigDecimalField() {
168: return this .bigDecimalField;
169: }
170:
171: public void setBigDecimalField(BigDecimal bigDecimalField) {
172: this .bigDecimalField = bigDecimalField;
173: }
174:
175: public Date getDateField() {
176: return this .dateField;
177: }
178:
179: public void setDateField(Date dateField) {
180: this .dateField = dateField;
181: }
182:
183: public Locale getLocaleField() {
184: return this .localeField;
185: }
186:
187: public void setLocaleField(Locale localeField) {
188: this .localeField = localeField;
189: }
190:
191: public Byte getByteObjfield() {
192: return this .byteObjfield;
193: }
194:
195: public void setByteObjfield(Byte byteObjfield) {
196: this .byteObjfield = byteObjfield;
197: }
198:
199: public Boolean getBooleanObjField() {
200: return this .booleanObjField;
201: }
202:
203: public void setBooleanObjField(Boolean booleanObjField) {
204: this .booleanObjField = booleanObjField;
205: }
206:
207: public Character getCharObjField() {
208: return this .charObjField;
209: }
210:
211: public void setCharObjField(Character charObjField) {
212: this .charObjField = charObjField;
213: }
214:
215: public Double getDoubleObjField() {
216: return this .doubleObjField;
217: }
218:
219: public void setDoubleObjField(Double doubleObjField) {
220: this .doubleObjField = doubleObjField;
221: }
222:
223: public Float getFloatObjField() {
224: return this .floatObjField;
225: }
226:
227: public void setFloatObjField(Float floatObjField) {
228: this .floatObjField = floatObjField;
229: }
230:
231: public Integer getIntObjField() {
232: return this .intObjField;
233: }
234:
235: public void setIntObjField(Integer intObjField) {
236: this .intObjField = intObjField;
237: }
238:
239: public Long getLongObjField() {
240: return this .longObjField;
241: }
242:
243: public void setLongObjField(Long longObjField) {
244: this .longObjField = longObjField;
245: }
246:
247: public Short getShortObjField() {
248: return this .shortObjField;
249: }
250:
251: public void setShortObjField(Short shortObjField) {
252: this .shortObjField = shortObjField;
253: }
254:
255: public TransactionalClassPC getTransField() {
256: return this .transField;
257: }
258:
259: public void setTransField(TransactionalClassPC transField) {
260: this .transField = transField;
261: }
262:
263: public RuntimeTest1 getSelfOneOne() {
264: return this .selfOneOne;
265: }
266:
267: public void setSelfOneOne(RuntimeTest1 selfOneOne) {
268: this .selfOneOne = selfOneOne;
269: }
270:
271: public Set getSelfOneMany() {
272: return this .selfOneMany;
273: }
274:
275: public void setSelfOneMany(Set selfOneMany) {
276: this.selfOneMany = selfOneMany;
277: }
278: }
|