[ 
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.
{color:#d04437}*Note: The syntax can be changed before introducation*{color}

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 AND p.age <= 35
        SELECT p.name

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

  was:
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 AND p.age <= 35
        SELECT p.name

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

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.
> {color:#d04437}*Note: The syntax can be changed before introducation*{color}
> 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 AND p.age <= 35
>       SELECT p.name
> assert ['Daniel', 'Alice'] == result
> {code}
> TBD



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

Reply via email to