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

http://datanucleus-appengine.googlecode.com/ · Java · 89 lines · 54 code · 17 blank · 18 comment · 0 complexity · 65f08c92db7f579d722fb8690e6b38b3 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.Id;
  18. import javax.persistence.JoinColumn;
  19. import javax.persistence.OneToOne;
  20. /**
  21. * @author Max Ross <maxr@google.com>
  22. */
  23. @Entity
  24. public class HasOneToOneStringPkJPA {
  25. @Id
  26. private String id;
  27. @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
  28. @JoinColumn(name = "book_id")
  29. private Book book;
  30. @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
  31. @JoinColumn(name = "haskeypk_id")
  32. private HasKeyPkJPA hasKeyPK;
  33. @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
  34. @JoinColumn(name = "hasparent_id")
  35. private HasOneToOneStringPkParentJPA hasParent;
  36. @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
  37. @JoinColumn(name = "hasparentkeypk_id")
  38. private HasOneToOneStringPkParentKeyPkJPA hasParentKeyPK;
  39. public String getId() {
  40. return id;
  41. }
  42. public void setId(String id) {
  43. this.id = 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 HasOneToOneStringPkParentJPA getHasParent() {
  58. return hasParent;
  59. }
  60. public void setHasParent(HasOneToOneStringPkParentJPA hasParent) {
  61. this.hasParent = hasParent;
  62. }
  63. public HasOneToOneStringPkParentKeyPkJPA getHasParentKeyPK() {
  64. return hasParentKeyPK;
  65. }
  66. public void setHasParentKeyPK(HasOneToOneStringPkParentKeyPkJPA hasParentKeyPK) {
  67. this.hasParentKeyPK = hasParentKeyPK;
  68. }
  69. }