Examples of Objectify


Examples of com.googlecode.objectify.Objectify

  }

  public static AuthorityEntity update(AuthorityEntity role) {
    AuthorityEntity existingEntity = null;
    try {
      Objectify ofy = OS.begin();
      existingEntity = ofy.get(AuthorityEntity.class, role.getAuthorityId());
      existingEntity.setUsername(role.getUsername());
      existingEntity.setAuthority(role.getAuthority());
      ofy.put(existingEntity);
    } catch (EntityNotFoundException enf) {
    }
    return existingEntity;
  }
View Full Code Here

Examples of com.googlecode.objectify.Objectify

    }
    return existingEntity;
  }

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

Examples of com.googlecode.objectify.Objectify

  }

  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);
      }
    } catch (NullPointerException npe) {
    }
  }
View Full Code Here

Examples of com.googlecode.objectify.Objectify

    }
  }

  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

Examples of com.googlecode.objectify.Objectify

    return null;
  }

  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

Examples of com.googlecode.objectify.Objectify

      // e.printStackTrace();
    }
  }

  public static WikiUser save(WikiUser wikiUser) {
    Objectify ofy = OS.begin();
    ofy.put(wikiUser);
    WIKIUSER_CACHE.put(wikiUser.getUsername(), wikiUser);
    return wikiUser;
  }
View Full Code Here

Examples of com.googlecode.objectify.Objectify

  public static WikiUser update(WikiUser wikiUser) {
    WikiUser existingEntity = null;
    try {

      Objectify ofy = OS.begin();
      existingEntity = ofy.get(WikiUser.class, wikiUser.getUserId());
      WIKIUSER_CACHE.remove(existingEntity.getUsername());
      existingEntity.setEmail(wikiUser.getEmail());
      existingEntity.setUsername(wikiUser.getUsername());
      // existingEntity.setGAEUser(wikiUser.getGAEUser());
      ofy.put(existingEntity);
      WIKIUSER_CACHE.put(existingEntity.getUsername(), existingEntity);
    } catch (EntityNotFoundException enf) {
    }
    return existingEntity;
  }
View Full Code Here

Examples of com.googlecode.objectify.Objectify

    return existingEntity;
  }

  public static void delete(WikiUser wikiUser) {
    WIKIUSER_CACHE.remove(wikiUser.getUserId());
    Objectify ofy = OS.begin();
    ofy.delete(wikiUser);
  }
View Full Code Here

Examples of com.googlecode.objectify.Objectify

  public static WikiUser findById(Long userId) {
    if (userId == null) {
      return null;
    }
    Objectify ofy = OS.begin();
    return ofy.find(WikiUser.class, userId);
  }
View Full Code Here

Examples of com.googlecode.objectify.Objectify

  }

  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
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.