Hey,
getUserQuery.setFilter("userLogin == vLogin AND password ==
vPassword"). Not "&&" but "AND".
Keep in mind, the filter is JDOQL (?), not Java.
Jake
On Feb 27, 11:05 am, Andriy Andrunevchyn <[email protected]> wrote:
> Don't work all "get" methods
> I've changed method according your advice it didn't help
> public UserModel getUserByLoginAndPassword(String login, String
> password) {
> PersistenceManager pm = getPersistenceManager();
> Query getUserQuery = pm.newQuery(UserModel.class);
> getUserQuery.setFilter("userLogin == vLogin && password ==
> vPassword");
> getUserQuery.declareParameters("String vLogin, String
> vPassword");
>
> UserModel result = null;
> try {
> List<UserModel> list = (List<UserModel>)
> getUserQuery.execute(
> login, password);
> if (!list.isEmpty()) {
> result = list.get(0);
> }
> } finally {
> getUserQuery.closeAll();
> releasePersistenceManager(pm);
> }
> return result;
> }
> Following method throw strange exception
> public UserModel getUserByLogin(String login) {
> PersistenceManager pm = getPersistenceManager();
> Query getUserQuery = pm
> .newQuery("select from UserModel userLogin ==
> vLogin parameters
> String vLogin");
> /*
> * getUserQuery.setFilter("userLogin == vLogin");
> * getUserQuery.declareParameters("String vLogin");
> */
> UserModel user = null;
> try {
> List<UserModel> result = (List<UserModel>)
> getUserQuery
> .execute(login);
> if (!result.isEmpty())
> user = result.get(0);
> } finally {
> getUserQuery.closeAll();
> releasePersistenceManager(pm);
> }
> return user;
> }
>
> org.datanucleus.store.appengine.FatalNucleusUserException: Candidate
> class could not be found: SELECT FROM UserModel userLogin == vLogin
> PARAMETERS String vLogin
> Perhaps I've forgotten some jdo configuration
> Does anybody know how to fix it?
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.