Objectify ofy = OS.begin();
ofy.delete(role);
}
public static RoleEntity findByName(String name) {
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;
} catch (EntityNotFoundException enfe) {
}
return null;
}