我使用带有JDO和JSP-servlet的Google App引擎编写应用程序,但它的错误关系: 我写代码类“Lop”
@PersistenceCapable
public class Lop {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;
@Persistent
private String tenLop;
@Persistent
private NamHoc namHoc;
@Persistent
private int siSo;
}
和班级“NamHoc”
@PersistenceCapable
public class NamHoc {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;
@Persistent
private String tenNamHoc;
@Persistent
private String tenHocKy;
}
首先,在插入Class Lop之后插入类NamHoc的数据,但是它是ralationship类NamHoc但是它创建了类NamHoc并且与它有关系。
EX:
类NamHoc键:aglub19hcHBfaWRyEAsSA0xvcBiAgICAgIDgCQw ID /名称: 6614661952700416 tenNamHoc:2013-2014 tenHocKy:HK1
Class Lop Key aglub19hcHBfaWRyEAsSA0xvcBiAgICAgICQCAw ID / Name: 4573968371548160 ...
但不是关系ID /姓名:6614661952700416