19:51
GAE/Jのparentとchildは変更出来ない?
一度作成したオブジェクトをほか子供にしようとしたら
try {
Parent p = new Parent("hoge");
Key cKey = KeyFactory.createKey(
Child.class.getSimpleName(), "fuga");
Child c = new Child(cKey);
pm.makePersistent(c);
pm.makePersistent(p);
p.setChild(c);
} finally {
pm.close();
}
Detected attempt to establish Parent(hoge) as the parent of Child(fuga) but the entity identified by Child(fuga) has already been persisted without a parent. A parent cannot be established or changed once an object has been persisted.と言われてしまった。つまり、一度parentを設定してしまったら、変更は不可能の模様。これって要するに1レコードでデータが格納されるということなんだろうか。 なかなか難しいですな