PageRenderTime 48ms CodeModel.GetById 41ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

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

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