-1

This looks like an absurd question but I am having problem with starting to code with Objectify v4 in appengine.

The introduction on objectify page says that you should use ofy to do all the operations. For this they have shown this to use

import static com.googlecode.objectify.ObjectifyService.ofy;

Thing th = ofy().load().key(thingKey).get();

Now the thing is in my eclipse auto suggestion it is not showing my ofy() thing. When I am importing the first line which I have written above it shows error.

I just want to know how to get ofy() to use?

Thanks

t0mkaka
  • 1,843
  • 2
  • 17
  • 21
  • 1
    Which Java compiler version do you use? Which is the exact error message? Did you check your classpath? – Moritz Petersen Dec 27 '12 at 16:50
  • 1
    Do you have the Objectify JAR in your project? – Pixel Elephant Dec 27 '12 at 22:59
  • @PixelElephant Well it seems that I had downloaded the Objectify something with **4a** written on it. that was the only problem. When I replaced it with **4b01** it started working. Thanks for replying. – t0mkaka Dec 28 '12 at 17:24

1 Answers1

3

Assuming the correct jar is on your build path, have you adjusted your content assist favorite settings? At the least it might throw an error that may help you.

From: http://code.google.com/p/objectify-appengine/wiki/Setup

Enable static imports in Eclipse

This step is optional, but will help prevent you from typing ObjectifyService.ofy() over >and over again.

Eclipse does not automatically add static imports when you Organize Imports. By default, >it won't even complete static imports when you type ofy[cmd-space]. If you want to save >yourself a lot of typing, add a "Favorite" static import for ObjectifyService.ofy().

Visit Window » Preferences » Java » Editor » Content Assist » Favorites and add: com.googlecode.objectify.ObjectifyService.ofy

Now, when you type ofy[cmd-space], Eclipse will add a static import for you.

Eclipse Optimize Imports to Include Static Imports may also help.

Community
  • 1
  • 1
Mark Doyle
  • 4,804
  • 3
  • 20
  • 23