Questions tagged [jdoql]

JDOQL is the query language of the JDO persistence API. JDOQL is designed as the Java developers way of having the power of SQL queries, yet retaining the Java object relationship that exist in their application model.

JDOQL is the query language of the JDO persistence API. JDOQL is designed as the Java developers way of having the power of SQL queries, yet retaining the Java object relationship that exist in their application model.

84 questions
5
votes
1 answer

JDO for Google App Engine: escaping quotes

How do I escape parameters of queries in JDO (Google App Engine)? For example, how do I make the next snippet safe, if the variable name may contain unsafe chars as single quotes (') PersistenceManager pm = ...; String query = "select from Person…
flybywire
  • 261,858
  • 191
  • 397
  • 503
5
votes
1 answer

Why am I getting a cast error in my Query using JDO on Google App Engine?

According to the Queries and Indexes doc you can go a query effectively identically (so far as I can tell) to this: PersistenceManager pm = PMF.get().getPersistenceManager(); try { Query q = pm.newQuery(App.class); q.setOrdering("name…
Jeremy Logan
  • 47,151
  • 38
  • 123
  • 143
4
votes
8 answers

App Engine datastore does not support operator OR

I am trying to query the google datastore for something like (with pm --> persistanceManager): String filters = "( field == 'value' || field == 'anotherValue' )"; Query query = pm.newQuery(myType.class, filters); When I execute - I am getting…
JohnIdol
  • 48,899
  • 61
  • 158
  • 242
4
votes
1 answer

Persistance JDO - How to query a property of a collection with JDOQL?

I want to build an application where a user identified by an email address can have several application accounts. Each account can have one or more users. I am trying to use the JDO Storage capabilities with Google App Engine Java. Here is my…
Sergio del Amo
  • 76,835
  • 68
  • 152
  • 179
3
votes
1 answer

GAE JDO Query sometimes returns with newest persisted entities missing

I am trying to build a simple app using google app engine, with java and JDO. my application creates Sale objects and persists them to the datastore, once persisted i attempt to list using a query, ALL the Sales in the datastore. however sometimes…
Arthur
  • 43
  • 3
3
votes
1 answer

What does ":P" mean in a JDO query

I am using JDO on google app engine. Each 'Employee' has a 'key'. I have a set of keys and wanted to retrieve all Employees whose key belongs to this set. So I implemented it using the 'contains()' filter as specified here. The code works fine and…
Gopi
  • 10,073
  • 4
  • 31
  • 45
3
votes
3 answers

How to do batch Google DataStore key lookup query in JDO

I have about 50k entities stored in appengine. I am able to look up an individual record via the GQL admin interface with a query like: SELECT * FROM Pet where __key__ = KEY( 'Pet','Fido') But I'm having trouble figuring out how to do a batch…
TheDon
  • 388
  • 1
  • 2
  • 11
3
votes
1 answer

How to retrieve a list of objects which are a property of a class with JDOQL?

I have the next persistence capable classes: @PersistenceCapable public class AppAccount { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Long id; @Persistent private String companyName; …
Sergio del Amo
  • 76,835
  • 68
  • 152
  • 179
3
votes
1 answer

Can I do a text search against a pattern when using Google App Engine?

All examples I'm seeing show how to pull up entities matching a string exactly. Is there an equivalent to a LIKE query? Also, if it helps, I'm thinking of using the result for an auto-completing a text box. Thanks
Allain Lalonde
  • 91,574
  • 70
  • 187
  • 238
2
votes
1 answer

JDO UnsupportedDatastoreFeatureException on Google App Engine

I am trying to use the get method for Map as described in http://db.apache.org/jdo/jdoql_methods.html on Google App Engine. My definition is as follows: public class FooInfo { ... @Persistent private Map vote = new HashMap(); ... } And…
coolsuntraveler
  • 317
  • 5
  • 13
2
votes
2 answers

Appengine: DatastoreNeedIndexException when using "order by"

Hello I have this DatastoreNeedIndexException when I try to order by my query. here is the code: @PersistenceCapable public class Gaze { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Long id; @Persistent Blob…
plus-
  • 45,453
  • 15
  • 60
  • 73
2
votes
1 answer

Java: JDOQL startsWith query, case sensitive

I'm using the .startsWith() filter in a JDOQL query but it's case sensitive. So startsWith("ab") doesn't return "Abc" result and so on. Will I need to use a SQL query to avoid this ?
Jla
  • 11,304
  • 14
  • 61
  • 84
2
votes
1 answer

How to write IN clause query in jdoQL?

I want to write a "IN" clause query in jdoQL similar to the given SQL query below. SELECT salary FROM employee where empId IN (1021,2013,9872); my objective is that i have a list of email addressess that i would be providing inside the "IN" clause…
Papps
  • 61
  • 1
  • 7
2
votes
1 answer

Datanucleus jdoql group by having avg()

I'm trying to write a query that returns all departments whose average salary of employees is within the specified range. I have something like this: Query query = pm.newQuery(Employee.class); query.setResult("department,…
maszter
  • 3,680
  • 6
  • 37
  • 53
1
vote
0 answers

How to apply fetch groups using JDOQL queries with datanucleus-appengine 2.0.0-final

After upgrading to the 2.0.0-final version of datanucleus-appengine, fetch groups now appear to be ignored when using JDOQL queries via the Query API. I'm not sure whether it's a bug in the library or I'm doing this wrong. I have a 'User' entity…
metarob
  • 11
  • 2
1
2 3 4 5 6