ITeye博客

Google Datastore for Java 文档摘录(三)

jinjiankang · 2009-07-26 14:15 · Google App Engine · 编程语言 · Java · Google · Markdown

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)

暂无评论。

评论功能维护中,当前仅展示历史评论。