Package com.googlecode.objectify

Examples of com.googlecode.objectify.Objectify.query()


     * @return Collection of Message
     */
    public Collection<Message> getAll() {
        final Objectify service = getService();

        return(service.query(Message.class).list());
    }

    /**
     * @param message
     */
 
View Full Code Here


    searchString = searchString.toLowerCase();

    ObjectifyService.register(Note.class);
    Objectify ofy = ObjectifyService.begin();

    Query<Note> q = ofy.query(Note.class).filter("parent", searchString)
        .order("-date");

    ArrayList<Note> notes = new ArrayList<Note>();

    // Loop the query results and add to the array
View Full Code Here

  public static void deleteByName(String name) {
    AuthorityEntity role;
    try {
      Objectify ofy = OS.begin();
      Query<AuthorityEntity> q = ofy.query(AuthorityEntity.class);
      // OS.createQuery(AuthorityEntity.class);
      q.filter("username", name);
      // Iterable<AuthorityEntity> it = ofy.prepare(q).asIterable();
      for (AuthorityEntity authorityEntity : q) {
        ofy.delete(authorityEntity);
View Full Code Here

  public static QueryResultIterable<AuthorityEntity> findByName(String name) {
    try {
      Objectify ofy = OS.begin();
      List<AuthorityEntity> resultList = null;
      // OQuery<AuthorityEntity> q = OS.createQuery(AuthorityEntity.class);
      Query<AuthorityEntity> q = ofy.query(AuthorityEntity.class);
      q.filter("username", name);
      // resultList = ofy.prepare(q).asList();
      return q;
    } catch (NullPointerException npe) {
    }
View Full Code Here

  public static QueryResultIterable<AuthorityEntity> getAll() {
    List<AuthorityEntity> resultList = null;
    Objectify ofy = OS.begin();
    // OQuery<AuthorityEntity> q = OS.createQuery(AuthorityEntity.class);
    Query<AuthorityEntity> q = ofy.query(AuthorityEntity.class);
    // resultList = ofy.prepare(q).asList();
    return q;
  }

}
View Full Code Here

  public static QueryResultIterable<WikiUser> findByFragment(
      String usernameFragment) {
    // List<WikiUser> resultList = null;
    Objectify ofy = OS.begin();
    // OQuery<WikiUser> q = OS.createQuery(WikiUser.class);
    Query<WikiUser> q = ofy.query(WikiUser.class);
    q.filter("username in", usernameFragment);
    // resultList = ofy.prepare(q).asList();
    return q;
  }
View Full Code Here

      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

  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

        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) {
View Full Code Here

    return null;
  }

  public static QueryResultIterable<WikiUser> getAll() {
    Objectify ofy = OS.begin();
    Query<WikiUser> q = ofy.query(WikiUser.class);
    return q;
  }
}
// WikiUser save(WikiUser user);
//
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.