Examples of Objectify


Examples of com.googlecode.objectify.Objectify

    WikiUser wikiUser = (WikiUser) WIKIUSER_CACHE.get(username);
    if (wikiUser != null) {
      return wikiUser;
    }
    try {
      Objectify ofy = OS.begin();
      // OQuery<WikiUser> q = OS.createQuery(WikiUser.class);
      Query<WikiUser> q = ofy.query(WikiUser.class);
      q.filter("username", username);
      wikiUser = q.get();// ofy.prepare(q).asSingle();
      WIKIUSER_CACHE.put(wikiUser.getUsername(), wikiUser);
      return wikiUser;
    } catch (NullPointerException npe) {
View Full Code Here

Examples of com.googlecode.objectify.Objectify

  }

  public static WikiUser findByEMail(String email) {
    WikiUser wikiUser = null;
    try {
      Objectify ofy = OS.begin();
      // OQuery<WikiUser> q = OS.createQuery(WikiUser.class);
      Query<WikiUser> q = ofy.query(WikiUser.class);
      q.filter("email", email);
      wikiUser = q.get();// ofy.prepare(q).asSingle();
      WIKIUSER_CACHE.put(wikiUser.getUsername(), wikiUser);
      return wikiUser;
    } catch (NullPointerException npe) {
View Full Code Here

Examples of com.googlecode.objectify.Objectify

      email = gaeUser.getEmail();
      WikiUser wikiUser = (WikiUser) WIKIUSER_CACHE.get(email);
      if (wikiUser != null) {
        return wikiUser;
      }
      Objectify ofy = OS.begin();
      try {
        // OQuery<WikiUser> q = OS.createQuery(WikiUser.class);
        Query<WikiUser> q = ofy.query(WikiUser.class);
        q.filter("email", email);
        wikiUser = q.get();// ofy.prepare(q).asSingle();
        WIKIUSER_CACHE.put(wikiUser.getUsername(), wikiUser);
        return wikiUser;
      } catch (NullPointerException npe) {
      }

      if (wikiUser == null) {
        wikiUser = new WikiUser();
        // wikiUser.setGAEUser(gaeUser);
        wikiUser.setEmail(email);
        String username = gaeUser.getNickname();
        if (username == null) {
          username = email;
        }
        wikiUser.setUsername(username);
        ofy.put(wikiUser);
        WIKIUSER_CACHE.put(wikiUser.getUsername(), wikiUser);
      }
    }
    return null;
  }
View Full Code Here

Examples of com.googlecode.objectify.Objectify

    }
    return null;
  }

  public static QueryResultIterable<WikiUser> getAll() {
    Objectify ofy = OS.begin();
    Query<WikiUser> q = ofy.query(WikiUser.class);
    return q;
  }
View Full Code Here

Examples of com.googlecode.objectify.Objectify

  /**
   *
   */
  public Topic getTopicId() {
// return this.topicId;
    Objectify ofy = OS.begin();
    try {
      return ofy.get(topicId);
    } catch (EntityNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    return null;
View Full Code Here

Examples of com.googlecode.objectify.Objectify

      // e.printStackTrace();
    }
  }

  public static Topic save(Topic page, LinkedHashMap<String, String> categories) {
    Objectify ofy = OS.begin();
    ofy.put(page);
    // if (catList != null && catList.size() > 0) {
    // ofy.put(catList);
    // }
    cache.put(page.getName(), page);
    return page;
View Full Code Here

Examples of com.googlecode.objectify.Objectify

  public static Topic update(Topic page,
      LinkedHashMap<String, String> categories) {
    Topic existingEntity = null;
    try {
      Objectify ofy = OS.begin();
      existingEntity = ofy.get(Topic.class, page.getName());
      existingEntity.setName(page.getName());
      existingEntity.setTopicContent(page.getTopicContent());
      ofy.put(existingEntity);
      // if (catList != null && catList.size() > 0) {
      // ofy.put(catList);
      // }
      cache.put(existingEntity.getName(), existingEntity);
View Full Code Here

Examples of com.googlecode.objectify.Objectify

    return existingEntity;
  }

  public static void delete(Topic page) {
    cache.remove(page.getName());
    Objectify ofy = OS.begin();
    ofy.delete(page);
  }
View Full Code Here

Examples of com.googlecode.objectify.Objectify

    Topic page = (Topic) cache.get(title);
    if (page != null) {
      return page;
    }
    try {
      Objectify ofy = OS.begin();
      page = ofy.get(new Key<Topic>(Topic.class, title));
      // Query<Topic> q = ofy.query(Topic.class);
      // q.filter("title", title);
      // page = ofy.prepare(q).asSingle();
      cache.put(page.getName(), page);
      return page;
View Full Code Here

Examples of com.googlecode.objectify.Objectify

    return "";
  }

  public static QueryResultIterable<Topic> getAll() {
    // List<Topic> resultList = null;
    Objectify ofy = OS.begin();
    // OQuery<Topic> q = OS.createQuery(Topic.class);
    Query<Topic> q = ofy.query(Topic.class);
    // resultList = ofy.prepare(q).asList();
    return q;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.