PageRenderTime 94ms CodeModel.GetById 81ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

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