`
jinjiankang
  • 浏览: 110141 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Google Datastore for Java 文档摘录(三)

阅读更多

You can modify an object after the PersistenceManager has been closed by declaring the class as "detachable." To do this, add the detachable attribute to the @PersistenceCapable annotation:

import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true")
public class Employee {
    // ...
}

 在我本机,按上述修改后,在pm.close();之后设置em.setFirstName("fffffffff");,但是,查看Datastore Viewer却发现firstName并不是"fffffffff",很奇怪?!

 

谁有不同结果请留言,谢谢。

0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics