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",很奇怪?!

 

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

你可能感兴趣的:(java,Google)