PageRenderTime 34ms CodeModel.GetById 25ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://datanucleus-appengine.googlecode.com/
Java | 113 lines | 72 code | 23 blank | 18 comment | 0 complexity | 4d420a519f9be9ae67fbf7d8b8900b82 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.CascadeType;
 21import javax.persistence.Entity;
 22import javax.persistence.FetchType;
 23import javax.persistence.GeneratedValue;
 24import javax.persistence.GenerationType;
 25import javax.persistence.Id;
 26import javax.persistence.JoinColumn;
 27import javax.persistence.OneToOne;
 28
 29/**
 30 * @author Max Ross <maxr@google.com>
 31 */
 32@Entity
 33public class HasOneToOneJPA {
 34
 35  @Id
 36  @GeneratedValue(strategy=GenerationType.IDENTITY)
 37  @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true")
 38  private String id;
 39
 40  @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
 41  @JoinColumn(name = "book_id")
 42  private Book book;
 43
 44  @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
 45  @JoinColumn(name = "haskeypk_id")
 46  private HasKeyPkJPA hasKeyPK;
 47
 48  @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
 49  @JoinColumn(name = "hasparent_id")
 50  private HasOneToOneParentJPA hasParent;
 51
 52  @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
 53  @JoinColumn(name = "hasparentkeypk_id")
 54  private HasOneToOneParentKeyPkJPA hasParentKeyPK;
 55
 56  @OneToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH}, fetch = FetchType.LAZY)
 57  @JoinColumn(name = "notdependent_id")
 58  private HasEncodedStringPkJPA notDependent;
 59
 60  private String str;
 61
 62  public String getId() {
 63    return id;
 64  }
 65
 66  public Book getBook() {
 67    return book;
 68  }
 69
 70  public void setBook(Book book) {
 71    this.book = book;
 72  }
 73
 74  public HasKeyPkJPA getHasKeyPK() {
 75    return hasKeyPK;
 76  }
 77
 78  public void setHasKeyPK(HasKeyPkJPA hasKeyPK) {
 79    this.hasKeyPK = hasKeyPK;
 80  }
 81
 82  public HasOneToOneParentJPA getHasParent() {
 83    return hasParent;
 84  }
 85
 86  public void setHasParent(HasOneToOneParentJPA hasParent) {
 87    this.hasParent = hasParent;
 88  }
 89
 90  public HasOneToOneParentKeyPkJPA getHasParentKeyPK() {
 91    return hasParentKeyPK;
 92  }
 93
 94  public void setHasParentKeyPK(HasOneToOneParentKeyPkJPA hasParentKeyPK) {
 95    this.hasParentKeyPK = hasParentKeyPK;
 96  }
 97
 98  public HasEncodedStringPkJPA getNotDependent() {
 99    return notDependent;
100  }
101
102  public void setNotDependent(HasEncodedStringPkJPA notDependent) {
103    this.notDependent = notDependent;
104  }
105
106  public String getStr() {
107    return str;
108  }
109
110  public void setStr(String str) {
111    this.str = str;
112  }
113}