Package com.googlecode.objectify

Examples of com.googlecode.objectify.Objectify


    return existingEntity;
  }

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


    Objectify ofy = OS.begin();
    ofy.delete(page);
  }

  public static void deleteTopicCategories(Topic topic) {
    Objectify ofy = OS.begin();
    Query<Category> q = ofy.query(Category.class);
    q.filter("childTopicName", topic.getName());
    ofy.delete(q);
  }
View Full Code Here

  // }
  // return null;
  // }

  public static QueryResultIterable<Category> lookupCategoryTopics(String virtualWiki, String categoryName) {
    Objectify ofy = OS.begin();
    Query<Category> q = ofy.query(Category.class);
    q.filter("name", categoryName);
    q.filter("virtualWiki", virtualWiki);
    return q;
  }
View Full Code Here

    return q;
  }

  public static QueryResultIterable<Category> getAll(String virtualWiki) {
    // List<Category> resultList = null;
    Objectify ofy = OS.begin();
    Query<Category> q = ofy.query(Category.class);
    q.filter("virtualWiki", virtualWiki);
    // resultList = ofy.prepare(q).asList();
    return q;
  }
View Full Code Here

    return q;
  }

  public static QueryResultIterable<Category> getAll() {
    // List<Category> resultList = null;
    Objectify ofy = OS.begin();
    Query<Category> q = ofy.query(Category.class);
    // resultList = ofy.prepare(q).asList();
    return q;
  }
View Full Code Here

import com.googlecode.objectify.Objectify;

public class UserService {

  public static UserEntity save(UserEntity page) {
    Objectify ofy = OS.begin();
    ofy.put(page);
    return page;
  }
View Full Code Here

  }

  public static UserEntity update(UserEntity role) {
    UserEntity existingEntity = null;
    try {
      Objectify ofy = OS.begin();
      existingEntity = ofy.get(UserEntity.class, role.getUsername());
      existingEntity.setPassword(role.getPassword());
      ofy.put(existingEntity);
    } catch (EntityNotFoundException enf) {
    }
    return existingEntity;
  }
View Full Code Here

    }
    return existingEntity;
  }

  public static void delete(UserEntity role) {
    Objectify ofy = OS.begin();
    ofy.delete(role);
  }
View Full Code Here

    ofy.delete(role);
  }

  public static boolean isAuthenticated(String username,
      String encryptedPassword) {
    Objectify ofy = OS.begin();
    // OQuery<WikiUser> q = OS.createQuery(WikiUser.class);
    Query<WikiUser> q = ofy.query(WikiUser.class);

    q.filter("username", username);
    q.filter("password", encryptedPassword);
    return q.countAll() > 0;
    // return ofy.prepare(q).asSingle() != null;
View Full Code Here

  }

  public static UserEntity findByName(String name) {
    UserEntity role = null;
    try {
      Objectify ofy = OS.begin();
      // OQuery<UserEntity> q = OS.createQuery(UserEntity.class);
      Query<WikiUser> q = ofy.query(WikiUser.class);
      return ofy.get(UserEntity.class, name);
      // q.filter("username", name);
      // role = ofy.prepare(q).asSingle();
      // return role;
    } catch (EntityNotFoundException enfe) {
    }
View Full Code Here

TOP

Related Classes of com.googlecode.objectify.Objectify

Copyright © 2018 www.massapicom. 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.