DatastoreService datastore = DatastoreSingleton.getInstance();
Filter loginFilter = new FilterPredicate("login", FilterOperator.EQUAL, loginOrEmail);
Filter emailFilter = new FilterPredicate("email", FilterOperator.EQUAL, loginOrEmail);
Query q = new Query("User").setFilter(CompositeFilterOperator.or(loginFilter, emailFilter));
PreparedQuery pq = datastore.prepare(q);
Entity e = pq.asSingleEntity();
if(e == null) {
return null;
}
return createModel(e);
}