如何使用@PrePersist方法阻止Objectify在没有@Transient注释的情况下保存属性?
可以像这样设置一个例子:
public class MyEntity {
@Id Long id;
String dontWantToSaveThis;
public MyEntity(){
}
@PrePersist
public void prePersist(Objectify ofy, Entity ent) {
// Here I want to prevent "dontWantToSaveThis" field to be saved!
}
}