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
1
vote
1 answer

Google Datastore problem with query on *User* type

On this question I solved the problem of querying Google Datastore to retrieve stuff by user (com.google.appengine.api.users.User) like this: User user = userService.getCurrentUser(); String select_query = "select from " + Greeting.class.getName();…
JohnIdol
  • 48,899
  • 61
  • 158
  • 242
1
vote
1 answer

How to fetch data by user from google datastore?

I am playing with google app engine and having a bit of trouble on JDOQL queries. The example shows how to fetch stuff from the datastore: PersistenceManager pm = PMF.get().getPersistenceManager(); String query = "select from " +…
JohnIdol
  • 48,899
  • 61
  • 158
  • 242
1
vote
1 answer

Why error "Joins are only supported when all filters are 'equals' filters."

I am not sure what am I doning wrong here? It complains "Joins are only supported when all filters are 'equals' filters." when the query is executed. How can I get around that? Query query = pm.newQuery(ItemInfo.class); if (lastSyncDate != null) { …
angelokh
  • 9,426
  • 9
  • 69
  • 139
1
vote
0 answers

How to do range query with Datanucleus/JDO?

What would be the Datanucleus/JDO implementation to this: Suppose I have a POJO, Hub which represents a place/location: class Hub { List schedules; } And a Schedule class to represent a specific day schedule of opening and closing of…
Fireburn
  • 981
  • 6
  • 20
1
vote
0 answers

Using String.matches() as a Query filter in JDO Query yields no results

Using the code below: Query query = newJdoQuery(); query.setFilter("identifier.matches('partner|account')"); query.execute(); yields no result. Why? However, replacing the regex part with 'partner'. The query yields 1 result. Replacing it with…
paul
  • 372
  • 4
  • 17
1
vote
1 answer

JDOQL (Appengine) - Query for all/one items with a list as parameter?

I'm trying to create a query so that all items of a given list (parameter) are contained in a a table's column (which is also a list). I also need a query so that at least one item of a given list (parameter) are contained in a table's column. For…
GWTNoob
  • 51
  • 3
1
vote
3 answers

In SQL or GQL or JDOQL, how can I query for the row that has the highest value in 2 columns (that have the lowest difference)?

Say for example I have a table: Table: Message | data | likes | dislikes | How can I efficiently find the row that has the highest number of likes and dislikes i.e. most controversial. So for the following example: {("Hello", 10, 5) ("Ola!", 5,…
GWTNoob
  • 51
  • 3
1
vote
0 answers

Selecting single distinct column from GAE datastore and order by date

My datastore contains following structure | id | date | property | |:-------------------------------------|--------------:|:---------: | | 78c94c24-8895-11e7-bb31-be2e44b06b34 | 1503556140000 |…
User
  • 79
  • 1
  • 1
  • 9
1
vote
1 answer

JDOQL Subquery count problems

I am having trouble with subquery counts with JDOQL (using DataNucleus). The following query SELECT this.price FROM com.mysema.query.jdo.test.domain.Product WHERE (SELECT count(other) FROM com.mysema.query.jdo.test.domain.Product other WHERE…
Timo Westkämper
  • 21,824
  • 5
  • 78
  • 111
1
vote
2 answers

Why does JDOQL query using "matches" semantics only work with a literal?

I'm trying to construct a JDOQL query (using datanucleus) that will search for matches of a parent class based on criteria in an owned one-to-many child class. The query looks like this: Query lQ = lPm.newQuery("select from…
1
vote
2 answers

Problem with JDOQL to obtain results with a "contains" request

I am using Google App Engine for a project and I need to do some queries on the database. I use the JDOQL to ask the database. In my case I want to obtain the university that contains the substring "array". I think my query has a mistake because it…
Michaël
  • 3,679
  • 7
  • 39
  • 64
1
vote
0 answers

FetchPlan does not work

I'm new to the subject so pardon me if I am missing or misunderstanding something. I'm using JDO 3.1rc1 and DataNucleus 3.2.7. This is my data class (kept it short as much as…
CyberMew
  • 1,159
  • 1
  • 16
  • 33
1
vote
1 answer

Subqueries on Java GAE Datastore

I am trying to create a database of users with connection between users (friends list). There are 2 main tables: UserEntity (main field id) and FriendEntity with fields: - initiatorId - id of user who initiated the friendship - friendId - id of…
Dmitry
  • 2,837
  • 1
  • 30
  • 48
1
vote
2 answers

Query by datetime in JDOQL / Java / GAE

I'm working on a GAE app. I want to query datastore and retrieve all records between startDate and endDate. Each record has a datetime field. I'm using a query similar to this (the below code is something I quickly grabbed - I'm not near my…
Jan K.
  • 1,607
  • 2
  • 13
  • 22
1
vote
1 answer

JDOQL to embed objects from different databases

I have a data object, AssetDO, in the database table FOO.DBO.ASSET. Asset has a column for userId, which refers to a table in a different database, BAR.DBO.USER. Is it possible to write a JDOQL query that supports UserDO (the user objecT) being…
Eric Stein
  • 13,209
  • 3
  • 37
  • 52