Renjith
Renjith

Reputation: 3274

Objectify 4 throwing strange error in GAE

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

But eclipse is complaining that The method now() is undefined for the type Ref<User>.

I am using objectify4 with spring for a GAE project.

Upvotes: 0

Views: 136

Answers (2)

Renjith
Renjith

Reputation: 3274

The correct method is

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

Upvotes: 0

stickfigure
stickfigure

Reputation: 13556

Ref does not have a method now(). You can see its signature here:

http://docs.objectify-appengine.googlecode.com/git/apidocs/com/googlecode/objectify/Ref.html

Upvotes: 0

Related Questions