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

http://datanucleus-appengine.googlecode.com/ · Java · 45 lines · 33 code · 12 blank · 0 comment · 0 complexity · 9e73135cc68e3b086ecf67ecfd8844d8 MD5 · raw file

  1. package com.google.appengine.datanucleus.test;
  2. import java.util.TreeSet;
  3. import javax.jdo.annotations.Extension;
  4. import javax.jdo.annotations.IdGeneratorStrategy;
  5. import javax.jdo.annotations.PersistenceCapable;
  6. import javax.jdo.annotations.Persistent;
  7. import javax.jdo.annotations.PrimaryKey;
  8. @PersistenceCapable
  9. public class Issue165Parent {
  10. @PrimaryKey
  11. @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  12. @Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
  13. private String id;
  14. @Persistent
  15. String aString;
  16. @Persistent
  17. Issue165Child child;
  18. @Persistent(mappedBy="parent")
  19. TreeSet<Issue165Child2> children2 = new TreeSet<Issue165Child2>();
  20. public void setChild(Issue165Child c) {
  21. child = c;
  22. child.parent = this;
  23. }
  24. public void addChild2(Issue165Child2 child) {
  25. children2.add(child);
  26. }
  27. public String getId() {
  28. return id;
  29. }
  30. public void setAString(String str) { aString = str;}
  31. public Issue165Child getChild() {return child;}
  32. public TreeSet<Issue165Child2> getChildren2() {return children2;}
  33. }