DataNucleus - Products
  History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CORE-2861
Type: New Feature New Feature
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Erik Bengtson
Reporter: Erik Bengtson
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JPOX Core

JDOQL extension: Named Sets/Variables/Arrays

Created: 06/Jun/06 10:49 PM   Updated: 08/Jan/09 11:24 AM
Component/s: None
Affects Version/s: 1.1.0
Fix Version/s: None


 Description  « Hide
Extend JDOQL to allow definition of named sets, variables and arrays. In SQL the similar result is obtained with using SUBQueries, however the subqueries allows only one column to be returned.

The named sets, variables and arrays can have any value as like:
Set<Person>
List<Dog>
Set<String>
String
String[]
Integer[]
etc...

The named values can be declared in this form:

WITH Set person AS SELECT FROM Person
SELECT...

Here is another example:

WITH String name AS SELECT UNIQUE name FROM Person where lastName == 'Buddy'
WITH Set person AS SELECT FROM Person
SELECT...

The usage is exemplified below

WITH Integer average AS SELECT avg(age) FROM Person
SELECT FROM Person where age > average


The query using WITH can be compiled/solved in one or more steps. It will vary upon the dependencies from one SELECT to another one. The example using the avg operation can be solved in one step, however the below query many not. (To be further designed)

WITH Set employees AS SELECT FROM Employee
SELECT FROM Person where employess.contains(this)


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Erik Bengtson - 16/Feb/08 11:03 AM
implemented via jdo/jpa subqueries