Beispiel #1
0
 public static PropertyEntity findByKey(String key) {
   try {
     Objectify ofy = OS.begin();
     return ofy.get(PropertyEntity.class, key);
   } catch (EntityNotFoundException enf) {
   }
   return null;
 }
Beispiel #2
0
  public static void saveAll(Properties properties) {
    PropertyEntity page;
    Objectify ofy = OS.begin();

    Enumeration<Object> keyEnum = properties.keys();
    while (keyEnum.hasMoreElements()) {
      String key = (String) keyEnum.nextElement();
      String value = (String) properties.get(key.toString());
      if (value != null) {
        page = new PropertyEntity(key, value);
        ofy.put(page);
      }
    }
  }
Beispiel #3
0
 public static QueryResultIterable<PropertyEntity> getAll() {
   Objectify ofy = OS.begin();
   Query<PropertyEntity> q = ofy.query(PropertyEntity.class);
   return q;
 }
Beispiel #4
0
 public static void delete(PropertyEntity property) {
   Objectify ofy = OS.begin();
   ofy.delete(property);
 }
Beispiel #5
0
 public static PropertyEntity save(PropertyEntity page) {
   Objectify ofy = OS.begin();
   ofy.put(page);
   return page;
 }