final DatastoreService dss = DatastoreServiceFactory
.getDatastoreService();
Query query = new Query开发者_运维知识库("GQL query goes here!");
/*
* Like this GQL query:
*
q = db.GqlQuery("SELECT * FROM People "
"WHERE first_name = John "
"AND last_name = Smith")
*/
*/
Is there any way to make it possible?
The thing is, I want to allow the user to provide his own query constraints.This isn't possible with the low-level datastore service. GQL is parsed by the API; the backend does not speak a textual query language.
Why do you want to do this? Letting a user provide a query string is usually a (very) Bad Idea.
精彩评论