애플 리케이션 엔진에 트리 구조를 저장하려고합니다. 내 수업에는 부모와 같은 유형의 자녀 목록이 있습니다. 모든 것은 children 속성을 추가 할 때까지 작동합니다. pm.makePersistent()를 호출하면 오류가 없지만 객체는 저장되지 않습니다. 왜 이것이 작동하지 않는지 아는 사람이 있습니까?동일한 유형의 자녀가있는 App Engine 클래스
이것은 내 수업입니다. App Engine 버전 1.2.2를 사용하고 있습니다.
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Composite {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key id;
@Persistent
private String name;
@Persistent
private Composite parent;
@Persistent(mappedBy = "parent")
private List<Composite> children;
public Composite(String name) {
this.name = name;
}
public Key getId() {
return id;
}
public void setId(Key id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public void setParent(Composite parent) {
this.parent = parent;
}
public Composite getParent() {
return parent;
}
public List<Composite> getChildren() {
return children;
}
public void addChild(Composite child) {
this.children.add(child);
}
}
모든 성공 등의 문제? 또는 부모 관계 처리를 DAO로 이전 했습니까? –
나는이 문제도 다루었 다. –