-1

I start google app engine with endpoints, I use objectify for persistence and I have an little question.(I hope !)

All my apiMethod start like it :

@ApiMethod(path = "getAccount", httpMethod = HttpMethod.GET)
public Account getAccount(@Named("idPlayer") long idPlayer) {
    ObjectifyLoader.loadEntity();

ObjectifyLoader.loadEntity(); is just a method like it

   public static void loadEntity(){
    ObjectifyService.register(Account.class); 
    ObjectifyService.register(WeaponsAccount.class); 
}

I got the impression that I register my class et each call to the api.

A tips for load only one time?

Thanks you for reading. Fabiitch

Connell.O'Donnell
  • 2,806
  • 11
  • 21
  • 39
fabiitch
  • 11
  • 1
  • 3

1 Answers1

0

You want to use a ServletContextListener. Check out this App Engine oage for an example.

saiyr
  • 2,535
  • 1
  • 9
  • 13