20:16
GAE/Jでparentは変更出来ないけど、childは追加可能
タイトルのまんま。
PersistenceManager pm = PMF.get().getPersistenceManager(); try { Parent parent = pm.getObjectById(Parent.class, "hoge"); List childList = parent.getChildList(); int r = (int) Math.floor(Math.random() * 100000); childList.add(new Child(KeyFactory.createKey(Child.class .getSimpleName(), "fuga" + r)).setName("fuga" + r)); } finally { pm.close(); }もちろん、削除もできる。
PersistenceManager pm = PMF.get().getPersistenceManager(); try { Parent parent = pm.getObjectById(Parent.class, "hoge"); List childList = parent.getChildList(); Child child = childList.get(0); pm.deletePersistent(child); } finally { pm.close(); }