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.kernel.common.apps;
020:
021: import java.io.IOException;
022: import java.io.ObjectInputStream;
023: import java.io.ObjectOutputStream;
024: import java.io.Serializable;
025: import javax.persistence.Column;
026: import javax.persistence.DiscriminatorValue;
027: import javax.persistence.Entity;
028: import javax.persistence.GeneratedValue;
029: import javax.persistence.GenerationType;
030: import javax.persistence.Id;
031: import javax.persistence.Version;
032:
033: import org.apache.openjpa.persistence.FetchAttribute;
034: import org.apache.openjpa.persistence.FetchGroup;
035: import org.apache.openjpa.persistence.FetchGroups;
036:
037: @Entity
038: @DiscriminatorValue("ATTACH_A")
039: @FetchGroups({@FetchGroup(name="all",attributes={@FetchAttribute(name="stringArray",recursionDepth=0),@FetchAttribute(name="attachEArray",recursionDepth=0)})})
040: public class AttachA implements Serializable {
041:
042: @Id
043: @GeneratedValue(strategy=GenerationType.AUTO)
044: @Column(name="A_ID")
045: private int id;
046:
047: @Version
048: private int version;
049:
050: private String astr;
051: private int aint;
052: private double adbl;
053:
054: private String[] stringArray = new String[0];
055: private AttachE[] attachEArray = new AttachE[0];
056:
057: public int getId() {
058: return id;
059: }
060:
061: public void setAstr(String astr) {
062: this .astr = astr;
063: }
064:
065: public String getAstr() {
066: return this .astr;
067: }
068:
069: public void setAint(int aint) {
070: this .aint = aint;
071: }
072:
073: public int getAint() {
074: return this .aint;
075: }
076:
077: public void setAdbl(double adbl) {
078: this .adbl = adbl;
079: }
080:
081: public double getAdbl() {
082: return this .adbl;
083: }
084:
085: public void setStringArray(String[] stringArray) {
086: this .stringArray = stringArray;
087: }
088:
089: public String[] getStringArray() {
090: return this .stringArray;
091: }
092:
093: public void setAttachEArray(AttachE[] attachEArray) {
094: this .attachEArray = attachEArray;
095: }
096:
097: public AttachE[] getAttachEArray() {
098: return this .attachEArray;
099: }
100:
101: private void writeObject(ObjectOutputStream out) throws IOException {
102: out.defaultWriteObject();
103: }
104:
105: private void readObject(ObjectInputStream in) throws IOException,
106: ClassNotFoundException {
107: in.defaultReadObject();
108: }
109: }
|