PageRenderTime 38ms CodeModel.GetById 30ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

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

http://datanucleus-appengine.googlecode.com/
Java | 59 lines | 31 code | 10 blank | 18 comment | 0 complexity | ad1c14386ccbd926ca26bf7e45f37fe1 MD5 | raw file
 1/**********************************************************************
 2Copyright (c) 2011 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 javax.jdo.annotations.IdGeneratorStrategy;
19import javax.jdo.annotations.PersistenceCapable;
20import javax.jdo.annotations.Persistent;
21import javax.jdo.annotations.PrimaryKey;
22
23import com.google.appengine.datanucleus.annotations.Unowned;
24
25/**
26 * "Owner" of a 1-1 bidirectional relation in JDO, using unowned relations.
27 */
28@PersistenceCapable(detachable="true")
29public class UnownedJDOOneToOneBiSideA {
30  @PrimaryKey
31  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
32  Long id;
33
34  @Persistent
35  @Unowned
36  UnownedJDOOneToOneBiSideB other;
37
38  String name;
39
40  public Long getId() {
41    return id;
42  }
43
44  public void setName(String name) {
45    this.name = name;
46  }
47
48  public String getName() {
49    return name;
50  }
51
52  public void setOther(UnownedJDOOneToOneBiSideB other) {
53    this.other = other;
54  }
55
56  public UnownedJDOOneToOneBiSideB getOther() {
57    return other;
58  }
59}