/ Published in: Java
import com.google.appengine.api.datastore.Key;\\\\\\\\\\\\\\\\r\\\\\\\\\\\\\\\\nimport com.google.appengine.api.datastore.KeyFactory;
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
PersistenceManager pm = JDOHelper.getPersistenceManagerFactory("transactions-optional").getPersistenceManager(); DbObject_Device object = null; try{ object = pm.getObjectById(MyDbObject.class, objectDbKey); } if(object != null){ // Object was present in database } else{ // .. not present object = new DbObject(); } // change object values here pm.makePersistent(object ); pm.close();