@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable ="false")
public class Foo implements IsSerializable {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long id;
@Persistent
private Long revision;
@Persistent
private String information;
}
问题是这个对象在持久化时会不断覆盖自己,而不是在下一个修订版中创建新的“记录”。在传统的RDBMS中,它是一个两列的主键。
如何使用Google App Engine Datastore完成此任务?