/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. /**********************************************************************
  2. Copyright (c) 2009 Google Inc.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. **********************************************************************/
  13. package com.google.appengine.datanucleus.test;
  14. import javax.persistence.CascadeType;
  15. import javax.persistence.Entity;
  16. import javax.persistence.FetchType;
  17. import javax.persistence.GeneratedValue;
  18. import javax.persistence.GenerationType;
  19. import javax.persistence.Id;
  20. import javax.persistence.JoinColumn;
  21. import javax.persistence.OneToOne;
  22. /**
  23. * @author Max Ross <maxr@google.com>
  24. */
  25. @Entity
  26. public class HasOneToOneLongPkJPA {
  27. @Id
  28. @GeneratedValue(strategy=GenerationType.IDENTITY)
  29. private Long id;
  30. @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
  31. @JoinColumn(name = "book_id")
  32. private Book book;
  33. @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
  34. @JoinColumn(name = "haskeypk_id")
  35. private HasKeyPkJPA hasKeyPK;
  36. @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
  37. @JoinColumn(name = "hasparent_id")
  38. private HasOneToOneLongPkParentJPA hasParent;
  39. @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
  40. @JoinColumn(name = "hasparentkeypk_id")
  41. private HasOneToOneLongPkParentKeyPkJPA hasParentKeyPK;
  42. public Long getId() {
  43. return id;
  44. }
  45. public Book getBook() {
  46. return book;
  47. }
  48. public void setBook(Book book) {
  49. this.book = book;
  50. }
  51. public HasKeyPkJPA getHasKeyPK() {
  52. return hasKeyPK;
  53. }
  54. public void setHasKeyPK(HasKeyPkJPA hasKeyPK) {
  55. this.hasKeyPK = hasKeyPK;
  56. }
  57. public HasOneToOneLongPkParentJPA getHasParent() {
  58. return hasParent;
  59. }
  60. public void setHasParent(HasOneToOneLongPkParentJPA hasParent) {
  61. this.hasParent = hasParent;
  62. }
  63. public HasOneToOneLongPkParentKeyPkJPA getHasParentKeyPK() {
  64. return hasParentKeyPK;
  65. }
  66. public void setHasParentKeyPK(HasOneToOneLongPkParentKeyPkJPA hasParentKeyPK) {
  67. this.hasParentKeyPK = hasParentKeyPK;
  68. }
  69. }