我有两张桌子Folder
,VirtualSystemEntry
我试图遵循这个Datanecous Turorial但它总是在StackOverFlowException
这里得到我迄今为止尝试过的结果
文件夹.java
@Entity
public class Folder implements IsSerializable{
@Id
@Column(name = "fvseID")
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
private String fvseID;
@OneToOne
@JoinColumn(name="vseID")
private VirtualSystemEntry vse=new VirtualSystemEntry();
}
虚拟系统入口.java
@Entity
public class VirtualSystemEntry implements IsSerializable {
@Id
@Column(name = "vseID")
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
private String id;
String label, image, tooltip;
private int x, y, tray;
@OneToOne(mappedBy="vse")
Folder parent = new Folder();
}
异常跟踪的一部分
INTERNAL_SERVER_ERROR</pre></p><h3>Caused by:</h3><pre>java.lang.StackOverflowError
at java.util.Hashtable.get(Hashtable.java:334)
at java.util.Properties.getProperty(Properties.java:932)
at java.lang.System.getProperty(System.java:653)
at com.google.appengine.tools.development.agent.runtime.Runtime.checkRestricted(Runtime.java:63)
at com.cbd.shared.entities.VirtualSystemEntry.<init>(VirtualSystemEntry.java:28)
at com.cbd.shared.entities.Folder.<init>(Folder.java:27)
at com.cbd.shared.entities.VirtualSystemEntry.<init>(VirtualSystemEntry.java:28)
at com.cbd.shared.entities.Folder.<init>(Folder.java:27)
at com.cbd.shared.entities.VirtualSystemEntry.<init>(VirtualSystemEntry.java:28)
at com.cbd.shared.entities.Folder.<init>(Folder.java:27)
at com.cbd.shared.entities.VirtualSystemEntry.<init>(VirtualSystemEntry.java:28)
at com.cbd.shared.entities.Folder..... and so on
那么我在这里做错了什么?顺便说一句,我正在使用GWT