android - Update query in DataStore of google app engine - java -
i newbie app engine. want update fields of entity in datastore. have created query
below neither updates entity nor throws error. don't know going wrong.i referred this post have huge collection of data. therefor, me, hard fetch hundreds of records , persist them.please me solve problem.
code:
@apimethod(name = "updateuserprofile", httpmethod = httpmethod.get, path = "userfeedmasterendpoint/updateprofile") public void updateuserprofile(@named("username") string uname, @named("uabout") string userabout) { entitymanager mgr = null; try { mgr = getentitymanager(); query query = mgr .createquery("update userfeedmaster u set u.userabout = :uabout u.username=:username"); query.setparameter("username", uname); query.setparameter("uabout", userabout); query.executeupdate(); } catch (exception e) { e.printstacktrace(); } return; }
a query ask datastore set of object satisfying criteria , retrieve these. update object need retrieve (with query instance), update object , put in datastore (by calling orm put method).
Comments
Post a Comment