PageRenderTime 16ms CodeModel.GetById 8ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://datanucleus-appengine.googlecode.com/
Java | 65 lines | 36 code | 11 blank | 18 comment | 0 complexity | 0c2716a2aef9ce13e9d4c5567273265e 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 org.datanucleus.api.jpa.annotations.Extension;
19
20import javax.persistence.Entity;
21import javax.persistence.FetchType;
22import javax.persistence.GeneratedValue;
23import javax.persistence.GenerationType;
24import javax.persistence.Id;
25import javax.persistence.OneToOne;
26
27/**
28 * @author Max Ross <maxr@google.com>
29 */
30@Entity
31public class HasOneToOneParentJPA {
32  @Id
33  @GeneratedValue(strategy=GenerationType.IDENTITY)
34  @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true")
35  private String id;
36
37  @OneToOne(mappedBy = "hasParent", fetch = FetchType.LAZY)
38  private HasOneToOneJPA parent;
39
40  private String str;
41
42  public String getId() {
43    return id;
44  }
45
46  public HasOneToOneJPA getParent() {
47    return parent;
48  }
49
50  public void setParent(HasOneToOneJPA parent) {
51    this.parent = parent;
52  }
53
54  public String getStr() {
55    return str;
56  }
57
58  public void setStr(String str) {
59    this.str = str;
60  }
61
62  public void setId(String id) {
63    this.id = id;
64  }
65}