java - Unable to get object from datastore using objectify -
i working on simple expenses manager deployed on google appengine. using objectify appengine orm. problem unable simple object datastore. session here null !! when check out in localhost datastore can see there !
@override public string findemailbysessionid(string sid) { session session = datastore.load().type(session.class).id(sid).now(); if (session != null && (session.getdate().after(new date()) || session.istoberemembered())) { return session.getemail(); } // null ! return null; }
@entity public class session { private string email; @id private string sessionid; private date date; private boolean toberemembered; @parent private key<user> parent; ......... }
@entity public class user { @id private string email; private string name; private string password; private date dateofbirth; private string hashsalt; public user() { }
ok, i've got answer , silly. stupid.
in google documentation there restriction on query says:
*filtering on unindexed properties returns no results !!!! * link objectify index property property should annotated @index
annotation. in code above forgot put @index annotation on date
! , problem. after put annotation returned normal.
Comments
Post a Comment