PageRenderTime 26ms CodeModel.GetById 2ms app.highlight 20ms RepoModel.GetById 2ms app.codeStats 0ms

/tests/com/google/appengine/datanucleus/test/BidirectionalSuperclassTableChildListJDO.java

http://datanucleus-appengine.googlecode.com/
Java | 319 lines | 221 code | 83 blank | 15 comment | 0 complexity | dafb6111bbdac6a2363811cbc897ebc7 MD5 | raw file
  1/**********************************************************************
  2 Copyright (c) 2011 Google Inc.
  3
  4 Licensed under the Apache License, Version 2.0 (the "License");
  5 you may not use this file except in compliance with the License.
  6 You may obtain a copy of the License at
  7
  8 http://www.apache.org/licenses/LICENSE-2.0
  9
 10 Unless required by applicable law or agreed to in writing, software
 11 distributed under the License is distributed on an "AS IS" BASIS,
 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13 See the License for the specific language governing permissions and
 14 limitations under the License.
 15 **********************************************************************/
 16 package com.google.appengine.datanucleus.test;
 17
 18import com.google.appengine.api.datastore.Key;
 19import com.google.appengine.datanucleus.test.HasPolymorphicRelationsJDO.HasOneToManyJDO;
 20import com.google.appengine.datanucleus.test.HasPolymorphicRelationsJDO.HasOneToManyLongPkJDO;
 21import com.google.appengine.datanucleus.test.HasPolymorphicRelationsJDO.HasOneToManyUnencodedStringPkJDO;
 22import com.google.appengine.datanucleus.test.HasPolymorphicRelationsListJDO.HasOneToManyList;
 23import com.google.appengine.datanucleus.test.HasPolymorphicRelationsListJDO.HasOneToManyListLongPk;
 24import com.google.appengine.datanucleus.test.HasPolymorphicRelationsListJDO.HasOneToManyListLongPkChildKeyPk;
 25import com.google.appengine.datanucleus.test.HasPolymorphicRelationsListJDO.HasOneToManyListStringPk;
 26import com.google.appengine.datanucleus.test.HasPolymorphicRelationsListJDO.HasOneToManyListUnencodedStringPk;
 27import com.google.appengine.datanucleus.test.HasPolymorphicRelationsListJDO.HasOneToManyListUnencodedStringPkChildKey;
 28
 29
 30import javax.jdo.annotations.Discriminator;
 31import javax.jdo.annotations.DiscriminatorStrategy;
 32import javax.jdo.annotations.Extension;
 33import javax.jdo.annotations.IdGeneratorStrategy;
 34import javax.jdo.annotations.Inheritance;
 35import javax.jdo.annotations.InheritanceStrategy;
 36import javax.jdo.annotations.PersistenceCapable;
 37import javax.jdo.annotations.Persistent;
 38import javax.jdo.annotations.PrimaryKey;
 39
 40public class BidirectionalSuperclassTableChildListJDO {
 41  
 42  @PersistenceCapable(detachable = "true")
 43  @Discriminator(column = "DISCRIMINATOR")
 44  public static class BidirTop implements BidirectionalSuperclassTableChildJDO.BidirTop {
 45
 46    @PrimaryKey
 47    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
 48    @Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value="true")
 49    private String id;
 50
 51    private String childVal;
 52    
 53    @Persistent
 54    private HasOneToManyList parent;
 55    
 56    public void setChildVal(String childVal) {
 57      this.childVal = childVal;
 58    }
 59
 60    public String getChildVal() {
 61      return childVal;
 62    }
 63
 64    public void setParent(HasOneToManyJDO parent) {
 65      this.parent = (HasOneToManyList)parent;
 66    }
 67
 68    public HasOneToManyJDO getParent() {
 69      return this.parent;
 70    }
 71
 72    public String getId() {
 73      return id;
 74    }
 75
 76    public int getPropertyCount() {
 77      return 2; // childVal, DISCRIMINATOR
 78    }
 79    
 80  }
 81  
 82  @PersistenceCapable(detachable = "true")
 83  public static class BidirMiddle extends BidirTop implements BidirectionalSuperclassTableChildJDO.BidirMiddle {
 84    private Long middleChildVal;
 85
 86    public Long getMiddleChildVal() {
 87      return middleChildVal;
 88    }
 89
 90    public void setMiddleChildVal(Long middleChildVal) {
 91      this.middleChildVal = middleChildVal;
 92    }
 93    
 94    public int getPropertyCount() {
 95      return 3; // childVal, middleChildVal, DISCRIMINATOR
 96    }
 97
 98  }
 99  
100  @PersistenceCapable(detachable = "true")
101  public static class BidirBottom extends BidirMiddle implements BidirectionalSuperclassTableChildJDO.BidirBottom {
102    private Double bottomChildVal;
103
104    public Double getBottomChildVal() {
105      return bottomChildVal;
106    }
107
108    public void setBottomChildVal(Double bottomChildVal) {
109      this.bottomChildVal = bottomChildVal;
110    }
111
112    public int getPropertyCount() {
113      return 4; // childVal, middleChildVal, bottomChildVal, DISCRIMINATOR
114    }
115  }
116
117  @PersistenceCapable(detachable = "true")
118  @Discriminator(column = "DISCRIMINATOR")
119  public static class BidirTopLongPk implements BidirectionalSuperclassTableChildJDO.BidirTopLongPk {
120
121    @PrimaryKey
122    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
123    @Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value="true")
124    private String id;
125
126    private String childVal;
127    
128    @Persistent
129    private HasOneToManyListLongPk parent;
130    
131    public void setChildVal(String childVal) {
132      this.childVal = childVal;
133    }
134
135    public String getChildVal() {
136      return childVal;
137    }
138
139    public void setParent(HasOneToManyLongPkJDO parent) {
140      this.parent = (HasOneToManyListLongPk)parent;
141    }
142
143    public HasOneToManyLongPkJDO getParent() {
144      return this.parent;
145    }
146
147    public String getId() {
148      return id;
149    }
150    
151  }
152  
153  @PersistenceCapable(detachable = "true")
154  public static class BidirMiddleLongPk extends BidirTopLongPk implements BidirectionalSuperclassTableChildJDO.BidirMiddleLongPk {
155  }
156  
157  @PersistenceCapable(detachable = "true")
158  public static class BidirBottomLongPk extends BidirMiddleLongPk implements BidirectionalSuperclassTableChildJDO.BidirBottomLongPk {
159  }
160  
161  @PersistenceCapable(detachable = "true")
162  @Inheritance(strategy = InheritanceStrategy.NEW_TABLE)
163  @Discriminator(strategy = DiscriminatorStrategy.VALUE_MAP, value = "T")
164  public static class BidirTopUnencodedStringPk implements BidirectionalSuperclassTableChildJDO.BidirTopUnencodedStringPkJDO {
165
166    @PrimaryKey
167    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
168    @Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value="true")
169    private String id;
170
171    private String childVal;
172    
173    @Persistent
174    private HasOneToManyListUnencodedStringPk parent;
175    
176    public void setChildVal(String childVal) {
177      this.childVal = childVal;
178    }
179
180    public String getChildVal() {
181      return childVal;
182    }
183
184    public void setParent(HasOneToManyUnencodedStringPkJDO parent) {
185      this.parent = (HasOneToManyListUnencodedStringPk)parent;
186    }
187
188    public HasOneToManyUnencodedStringPkJDO getParent() {
189      return this.parent;
190    }
191
192    public String getId() {
193      return id;
194    }
195    
196  }
197  
198  @PersistenceCapable(detachable = "true")
199  @Inheritance(strategy = InheritanceStrategy.SUPERCLASS_TABLE)
200  @Discriminator(value = "M")
201  public static class BidirMiddleUnencodedStringPk extends BidirTopUnencodedStringPk implements BidirectionalSuperclassTableChildJDO.BidirMiddleUnencodedStringPkJDO {
202
203  }
204
205  @PersistenceCapable(detachable = "true")
206  @Inheritance(strategy = InheritanceStrategy.SUPERCLASS_TABLE)
207  @Discriminator(value = "B")
208  public static class BidirBottomUnencodedStringPk extends BidirMiddleUnencodedStringPk implements BidirectionalSuperclassTableChildJDO.BidirBottomUnencodedStringPkJDO {
209
210  }
211
212  @PersistenceCapable(detachable = "true")
213  @Discriminator(column = "DISCRIMINATOR")
214  public static class BidirTopStringPk {
215
216    @PrimaryKey
217    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
218    @Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value="true")
219    private String id;
220
221    @Persistent
222    private HasOneToManyListStringPk parent;
223
224    @Persistent
225    private String childVal;
226
227    public String getId() {
228      return id;
229    }
230
231    public void setChildVal(String childVal) {
232      this.childVal = childVal;
233    }
234
235    public String getChildVal() {
236      return childVal;
237    }
238
239    public void setParent(HasOneToManyListStringPk parent) {
240      this.parent = parent;
241    }
242
243    public HasOneToManyListStringPk getParent() {
244      return this.parent;
245    }
246
247  }
248  
249  @PersistenceCapable(detachable = "true")
250  public static class BidirMiddleStringPk extends BidirTopStringPk {
251    
252  }
253  
254  @PersistenceCapable(detachable = "true")
255  public static class BidirBottomStringPk extends BidirMiddleStringPk {
256    
257  }
258
259  @PersistenceCapable(detachable = "true")
260  @Discriminator(column = "DISCRIMINATOR")
261  public static class BidirTopLongPkChildKey {
262
263    @PrimaryKey
264    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
265    private Key key;
266
267    @Persistent
268    private HasOneToManyListLongPkChildKeyPk parent;
269
270    public Key getKey() {
271      return key;
272    }
273
274    public HasOneToManyListLongPkChildKeyPk getParent() {
275      return parent;
276    }
277  }
278  
279  @PersistenceCapable(detachable = "true")
280  public static class BidirMiddleLongPkChildKey extends BidirTopLongPkChildKey {
281    
282  }
283
284  @PersistenceCapable(detachable = "true")
285  public static class BidirBottomLongPkChildKey extends BidirMiddleLongPkChildKey {
286    
287  }
288
289  @PersistenceCapable(detachable = "true")
290  @Discriminator(column = "DISCRIMINATOR")
291  public static class BidirTopUnencodedStringPkChildKey {
292    @PrimaryKey
293    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
294    private Key key;
295
296    @Persistent
297    private HasOneToManyListUnencodedStringPkChildKey parent;
298
299    public Key getKey() {
300      return key;
301    }
302
303    public HasOneToManyListUnencodedStringPkChildKey getParent() {
304      return parent;
305    }
306
307  }
308  
309  @PersistenceCapable(detachable = "true")
310  public static class BidirMiddleUnencodedStringPkChildKey extends BidirTopUnencodedStringPkChildKey {
311  
312  }
313  
314  @PersistenceCapable(detachable = "true")
315  public static class BidirBottomUnencodedStringPkChildKey extends BidirMiddleUnencodedStringPkChildKey {
316  
317  }
318
319}