【发布时间】:2012-09-03 04:02:20
【问题描述】:
我正在使用 DataNucleus 2 JDO 实现。我有一个必须附加的分离对象,但我不想附加所有字段(在本例中是一个集合)
public class Obj {
private String key;
private Collection<String> col;
}
是否有不能这样做的原因:
tx.begin();
obj.makeTransientAll(obj.getCol()); // Do not persist
pm.makePersistent(obj);
tx.commit();
或从数据库刷新:
tx.begin();
obj.refreshAll(obj.getCol()); // Discard any changes
pm.makePersistent(obj);
tx.commit();
谢谢。
【问题讨论】:
标签: persistence jdo datanucleus transient