PageRenderTime 21ms CodeModel.GetById 16ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://datanucleus-appengine.googlecode.com/
Java | 88 lines | 54 code | 16 blank | 18 comment | 0 complexity | 31780476e8b0380aa6b5bc64fce9de03 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 javax.persistence.CascadeType;
19import javax.persistence.Entity;
20import javax.persistence.FetchType;
21import javax.persistence.GeneratedValue;
22import javax.persistence.GenerationType;
23import javax.persistence.Id;
24import javax.persistence.JoinColumn;
25import javax.persistence.OneToOne;
26
27/**
28 * @author Max Ross <maxr@google.com>
29 */
30@Entity
31public class HasOneToOneLongPkJPA {
32
33  @Id
34  @GeneratedValue(strategy=GenerationType.IDENTITY)
35  private Long id;
36
37  @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
38  @JoinColumn(name = "book_id")
39  private Book book;
40
41  @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
42  @JoinColumn(name = "haskeypk_id")
43  private HasKeyPkJPA hasKeyPK;
44
45  @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
46  @JoinColumn(name = "hasparent_id")
47  private HasOneToOneLongPkParentJPA hasParent;
48
49  @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
50  @JoinColumn(name = "hasparentkeypk_id")
51  private HasOneToOneLongPkParentKeyPkJPA hasParentKeyPK;
52
53  public Long getId() {
54    return id;
55  }
56
57  public Book getBook() {
58    return book;
59  }
60
61  public void setBook(Book book) {
62    this.book = book;
63  }
64
65  public HasKeyPkJPA getHasKeyPK() {
66    return hasKeyPK;
67  }
68
69  public void setHasKeyPK(HasKeyPkJPA hasKeyPK) {
70    this.hasKeyPK = hasKeyPK;
71  }
72
73  public HasOneToOneLongPkParentJPA getHasParent() {
74    return hasParent;
75  }
76
77  public void setHasParent(HasOneToOneLongPkParentJPA hasParent) {
78    this.hasParent = hasParent;
79  }
80
81  public HasOneToOneLongPkParentKeyPkJPA getHasParentKeyPK() {
82    return hasParentKeyPK;
83  }
84
85  public void setHasParentKeyPK(HasOneToOneLongPkParentKeyPkJPA hasParentKeyPK) {
86    this.hasParentKeyPK = hasParentKeyPK;
87  }
88}