PageRenderTime 34ms CodeModel.GetById 29ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://datanucleus-appengine.googlecode.com/
Java | 86 lines | 50 code | 18 blank | 18 comment | 0 complexity | 89e727e73b3b90bd1d17c052ff7f6f15 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.persistence.CascadeType;
22import javax.persistence.Entity;
23import javax.persistence.Id;
24import javax.persistence.OneToMany;
25
26/**
27 * @author Max Ross <maxr@google.com>
28 */
29@Entity
30public class HasOneToManyStringPkListJPA {
31
32  @Id
33  private String id;
34
35  private String val;
36
37  @OneToMany(mappedBy = "parent", cascade = CascadeType.ALL)
38  private List<BidirectionalChildStringPkListJPA> bidirChildren =
39      new ArrayList<BidirectionalChildStringPkListJPA>();
40
41  @OneToMany(cascade = CascadeType.ALL)
42  private List<Book> books = new ArrayList<Book>();
43
44  @OneToMany(cascade = CascadeType.ALL)
45  private List<HasKeyPkJPA> hasKeyPks = new ArrayList<HasKeyPkJPA>();
46
47  public String getId() {
48    return id;
49  }
50
51  public void setId(String id) {
52    this.id = id;
53  }
54
55  public List<BidirectionalChildStringPkListJPA> getBidirChildren() {
56    return (List) bidirChildren;
57  }
58
59  public void nullBidirChildren() {
60    this.bidirChildren = null;
61  }
62
63  public List<Book> getBooks() {
64    return books;
65  }
66
67  public void nullBooks() {
68    this.books = null;
69  }
70
71  public List<HasKeyPkJPA> getHasKeyPks() {
72    return hasKeyPks;
73  }
74
75  public void nullHasKeyPks() {
76    this.hasKeyPks = null;
77  }
78
79  public String getVal() {
80    return val;
81  }
82
83  public void setVal(String val) {
84    this.val = val;
85  }
86}