Package com.googlecode.objectify

Examples of com.googlecode.objectify.Objectify


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


    }
    return null;
  }

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

import com.googlecode.objectify.Query;

public class GroupAuthorityService {

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

  }

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

    }
    return existingEntity;
  }

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

  }

  public static void deleteByGroupId(Long groupId) {
    // GroupAuthorityEntity role;
    try {
      Objectify ofy = OS.begin();
      // OQuery<GroupAuthorityEntity> q = OS
      // .createQuery(GroupAuthorityEntity.class);
      Query<GroupAuthorityEntity> q = ofy.query(GroupAuthorityEntity.class);
      q.filter("groupId", groupId);
      // Iterable<GroupAuthorityEntity> it = ofy.prepare(q).asIterable();
      ofy.delete(q);
      // for (GroupAuthorityEntity groupAuthorityEntity : q) {
      // ofy.delete(groupAuthorityEntity);
      // }
    } catch (NullPointerException npe) {
    }
View Full Code Here

  }

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

    return null;
  }

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

//      // e.printStackTrace();
//    }
//  }

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

  }

  public static Category update(Category category) {
    Category existingEntity = null;
    try {
      Objectify ofy = OS.begin();
      existingEntity = ofy.get(Category.class, category.getCategoryId());
      existingEntity.setChildTopicName(category.getChildTopicName());
      existingEntity.setSortKey(category.getSortKey());
      existingEntity.setVirtualWiki(category.getVirtualWiki());
      existingEntity.setTopicType(category.getTopicType());
      ofy.put(existingEntity);
//      cache.put(existingEntity.getName(), existingEntity);
    } catch (EntityNotFoundException enf) {
    }
    return existingEntity;
  }
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.