Google app engine 目标化4在GAE中抛出奇怪错误

Google app engine 目标化4在GAE中抛出奇怪错误,google-app-engine,google-cloud-datastore,objectify,gae-eclipse-plugin,Google App Engine,Google Cloud Datastore,Objectify,Gae Eclipse Plugin,但是eclipse抱怨Ref类型的方法now()未定义 我将objectify4与spring一起用于GAE项目。Ref现在没有方法()。您可以在此处看到其签名: 正确的方法是 Objectify ofy = objectifyFactory.begin(); User user= ofy.load().type(User.class).filter("userName", userName).first().now(); User user= ofy.load().type(

但是eclipse抱怨Ref类型的
方法now()未定义


我将objectify4与spring一起用于GAE项目。

Ref现在没有方法()。您可以在此处看到其签名:

正确的方法是

Objectify ofy = objectifyFactory.begin();
        User user= ofy.load().type(User.class).filter("userName", userName).first().now();
User user= ofy.load().type(User.class).filter("userName", userName).first().get();