01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: package org.apache.openjpa.persistence.kernel.common.apps;
20:
21: import java.util.HashSet;
22: import java.util.Map;
23: import java.util.Set;
24: import java.util.TreeMap;
25: import javax.persistence.CascadeType;
26: import javax.persistence.DiscriminatorValue;
27: import javax.persistence.Entity;
28: import javax.persistence.ManyToMany;
29:
30: import org.apache.openjpa.persistence.jdbc.KeyColumn;
31: import org.apache.openjpa.persistence.FetchAttribute;
32: import org.apache.openjpa.persistence.FetchGroup;
33: import org.apache.openjpa.persistence.FetchGroups;
34: import org.apache.openjpa.persistence.PersistentMap;
35: import org.apache.openjpa.persistence.jdbc.KeyColumn;
36:
37: @Entity
38: @DiscriminatorValue("ATTACH_B")
39: @FetchGroups({@FetchGroup(name="all",attributes={@FetchAttribute(name="ds",recursionDepth=0),@FetchAttribute(name="stringIntMap",recursionDepth=0)})})
40: public class AttachB extends AttachA {
41:
42: private String bstr;
43: private int bint;
44: private double bdbl;
45:
46: @ManyToMany(cascade={CascadeType.PERSIST,CascadeType.MERGE})
47: private Set<AttachD> ds = new HashSet();
48:
49: @PersistentMap
50: @KeyColumn(name="strngmap")
51: private Map<String, Integer> stringIntMap = new TreeMap<String, Integer>();
52:
53: public AttachB() {
54: }
55:
56: public void setBstr(String bstr) {
57: this .bstr = bstr;
58: }
59:
60: public String getBstr() {
61: return this .bstr;
62: }
63:
64: public void setBint(int bint) {
65: this .bint = bint;
66: }
67:
68: public int getBint() {
69: return this .bint;
70: }
71:
72: public void setBdbl(double bdbl) {
73: this .bdbl = bdbl;
74: }
75:
76: public double getBdbl() {
77: return this .bdbl;
78: }
79:
80: public void setDs(Set ds) {
81: this .ds = ds;
82: }
83:
84: public Set getDs() {
85: return this .ds;
86: }
87:
88: public void setStringIntMap(Map stringIntMap) {
89: this .stringIntMap = stringIntMap;
90: }
91:
92: public Map getStringIntMap() {
93: return this.stringIntMap;
94: }
95: }
|