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

http://datanucleus-appengine.googlecode.com/ · Java · 60 lines · 32 code · 10 blank · 18 comment · 0 complexity · bc72d2eef264b7b6271c1a33d956a238 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 com.google.appengine.api.datastore.Key;
  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.OneToOne;
  21. /**
  22. * @author Max Ross <maxr@google.com>
  23. */
  24. @Entity
  25. public class HasOneToOneParentKeyPkJPA {
  26. @Id
  27. @GeneratedValue(strategy=GenerationType.IDENTITY)
  28. private Key id;
  29. @OneToOne(mappedBy = "hasParentKeyPK", fetch = FetchType.LAZY)
  30. private HasOneToOneJPA parent;
  31. private String str;
  32. public Key getId() {
  33. return id;
  34. }
  35. public HasOneToOneJPA getParent() {
  36. return parent;
  37. }
  38. public void setParent(HasOneToOneJPA parent) {
  39. this.parent = parent;
  40. }
  41. public String getStr() {
  42. return str;
  43. }
  44. public void setStr(String str) {
  45. this.str = str;
  46. }
  47. }