PageRenderTime 32ms CodeModel.GetById 23ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://datanucleus-appengine.googlecode.com/
Java | 76 lines | 44 code | 14 blank | 18 comment | 0 complexity | 7cb775abfec171671ba59feaecec28f6 MD5 | raw file
 1/**********************************************************************
 2Copyright (c) 2009 Google Inc.
 3
 4Licensed under the Apache License, Version 2.0 (the "License");
 5you may not use this file except in compliance with the License.
 6You may obtain a copy of the License at
 7
 8http://www.apache.org/licenses/LICENSE-2.0
 9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15**********************************************************************/
16package com.google.appengine.datanucleus.test;
17
18import java.util.ArrayList;
19import java.util.List;
20
21import javax.jdo.annotations.Element;
22import javax.jdo.annotations.Extension;
23import javax.jdo.annotations.IdGeneratorStrategy;
24import javax.jdo.annotations.PersistenceCapable;
25import javax.jdo.annotations.Persistent;
26import javax.jdo.annotations.PrimaryKey;
27
28/**
29 * @author Max Ross <maxr@google.com>
30 */
31@PersistenceCapable(detachable = "true")
32public class BidirectionalChildListJDO implements BidirectionalChildJDO {
33
34  @PrimaryKey
35  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
36  @Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value="true")
37  private String id;
38
39  @Persistent
40  private HasOneToManyListJDO parent;
41
42  @Persistent(mappedBy = "parent")
43  @Element(dependent = "true")
44  private List<BidirectionalGrandchildListJDO> bidirGrandChildren =
45      new ArrayList<BidirectionalGrandchildListJDO>();
46
47  private String childVal;
48
49  public String getId() {
50    return id;
51  }
52
53  public HasOneToManyListJDO getParent() {
54    return parent;
55  }
56
57  public void setParent(HasOneToManyJDO parent) {
58    this.parent = (HasOneToManyListJDO) parent;
59  }
60
61  public String getChildVal() {
62    return childVal;
63  }
64
65  public void setChildVal(String childVal) {
66    this.childVal = childVal;
67  }
68
69  public List<BidirectionalGrandchildListJDO> getBidirGrandChildren() {
70    return bidirGrandChildren;
71  }
72
73  public void setBidirGrandChildren(List<BidirectionalGrandchildListJDO> bidirGrandChildren) {
74    this.bidirGrandChildren = bidirGrandChildren;
75  }
76}