Esempio n. 1
0
 public static PropertyEntity findByKey(String key) {
   try {
     Objectify ofy = OS.begin();
     return ofy.get(PropertyEntity.class, key);
   } catch (EntityNotFoundException enf) {
   }
   return null;
 }
Esempio n. 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);
      }
    }
  }
Esempio n. 3
0
 public static QueryResultIterable<PropertyEntity> getAll() {
   Objectify ofy = OS.begin();
   Query<PropertyEntity> q = ofy.query(PropertyEntity.class);
   return q;
 }
Esempio n. 4
0
 public static void delete(PropertyEntity property) {
   Objectify ofy = OS.begin();
   ofy.delete(property);
 }
Esempio n. 5
0
 public static PropertyEntity save(PropertyEntity page) {
   Objectify ofy = OS.begin();
   ofy.put(page);
   return page;
 }