You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Sun (JIRA)" <ji...@apache.org> on 2019/06/06 09:07:00 UTC

[jira] [Updated] (GROOVY-9159) [GEP] Support LINQ, aka GINQ

     [ https://issues.apache.org/jira/browse/GROOVY-9159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Sun updated GROOVY-9159:
-------------------------------
    Description: 
Reusing most of standard SQL syntax can make the learning curve smooth and avoid infringing the patent of Microsoft.

Here are some examples to show the proposed syntax:

*Filtering*
{code:java}
def numbers = [1, 2, 3]

def result =
	FROM numbers t       // t is an alias
	WHERE t.value <= 2
	SELECT t.value

assert [1, 2] == result
{code}

{code:java}
class Person {
	String name
	int age
}

def persons = [new Person(name: 'Daniel', age: 35), new Person(name: 'Peter', age: 10), new Person(name: 'Alice', age: 22)]

def result =
	FROM persons p       // p is an alias
	WHERE p.age > 15
	SELECT p.name

assert ['Daniel', 'Alice'] == result
{code}

TBD

  was:TBD


> [GEP] Support LINQ, aka GINQ
> ----------------------------
>
>                 Key: GROOVY-9159
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9159
>             Project: Groovy
>          Issue Type: New Feature
>            Reporter: Daniel Sun
>            Priority: Major
>             Fix For: 4.x
>
>
> Reusing most of standard SQL syntax can make the learning curve smooth and avoid infringing the patent of Microsoft.
> Here are some examples to show the proposed syntax:
> *Filtering*
> {code:java}
> def numbers = [1, 2, 3]
> def result =
> 	FROM numbers t       // t is an alias
> 	WHERE t.value <= 2
> 	SELECT t.value
> assert [1, 2] == result
> {code}
> {code:java}
> class Person {
> 	String name
> 	int age
> }
> def persons = [new Person(name: 'Daniel', age: 35), new Person(name: 'Peter', age: 10), new Person(name: 'Alice', age: 22)]
> def result =
> 	FROM persons p       // p is an alias
> 	WHERE p.age > 15
> 	SELECT p.name
> assert ['Daniel', 'Alice'] == result
> {code}
> TBD



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)