PageRenderTime 22ms CodeModel.GetById 2ms app.highlight 15ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://datanucleus-appengine.googlecode.com/
Java | 82 lines | 49 code | 15 blank | 18 comment | 0 complexity | a30d519e7b1295ac950a2612d2973f90 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.IdentityType;
25import javax.jdo.annotations.Order;
26import javax.jdo.annotations.PersistenceCapable;
27import javax.jdo.annotations.Persistent;
28import javax.jdo.annotations.PrimaryKey;
29
30/**
31 * @author Max Ross <maxr@google.com>
32 */
33@PersistenceCapable(identityType = IdentityType.APPLICATION)
34public class HasOneToManyListWithOrderByJDO implements HasOneToManyWithOrderByJDO {
35
36  @PrimaryKey
37  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
38  private Long id;
39
40  @Element(dependent = "true")
41  @Order(extensions = @Extension(vendorName = "datanucleus", key="list-ordering", value="origin DESC, dest ASC"))
42  private List<Flight> flightsByOrigAndDest = new ArrayList<Flight>();
43
44  @Element(dependent = "true")
45  @Order(extensions = @Extension(vendorName = "datanucleus", key="list-ordering", value="id DESC, origin ASC"))
46  private List<Flight> flightsByIdAndOrig = new ArrayList<Flight>();
47
48  @Element(dependent = "true")
49  @Order(extensions = @Extension(vendorName = "datanucleus", key="list-ordering", value="origin DESC, id ASC"))
50  private List<Flight> flightsByOrigAndId = new ArrayList<Flight>();
51
52  @Order(mappedBy="index")
53  private List<HasExplicitIndexColumnJDO> hasIndexColumn = new ArrayList<HasExplicitIndexColumnJDO>();
54
55  @Element(dependent = "true")
56  @Order(extensions = @Extension(vendorName = "datanucleus", key="list-ordering", value="key ASC"))
57  List<HasPkWithOverriddenColumnJDO> hasOverridenPk = new ArrayList<HasPkWithOverriddenColumnJDO>();
58
59  public Long getId() {
60    return id;
61  }
62
63  public List<Flight> getFlightsByOrigAndDest() {
64    return flightsByOrigAndDest;
65  }
66
67  public List<Flight> getFlightsByIdAndOrig() {
68    return flightsByIdAndOrig;
69  }
70
71  public List<Flight> getFlightsByOrigAndId() {
72    return flightsByOrigAndId;
73  }
74
75  public List<HasExplicitIndexColumnJDO> getHasIndexColumn() {
76    return hasIndexColumn;
77  }
78
79  public List<HasPkWithOverriddenColumnJDO> getHasPkWithOverridenColumns() {
80    return hasOverridenPk;
81  }
82}