cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dzmitry Kazimirchyk (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CAY-2053) SQLExec fluent query API
Date Mon, 25 Jan 2016 11:01:39 GMT

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

Dzmitry Kazimirchyk updated CAY-2053:
-------------------------------------
    Description: 
Implement fluent API for non-selecting SQL queries.

Some examples of the new SQLExec query syntax:

{code:java}
// insert
int inserted = SQLExec.query("INSERT INTO ARTIST (ARTIST_ID, ARTIST_NAME) VALUES (#bind($id),
#bind($name))").paramsArray(55, "a3").update(context);

// update
int updated = SQLExec.query("UPDATE ARTIST SET ARTIST_NAME = 'b3' WHERE ARTIST_NAME = 'a3'").update(context);
{code}

  was:
Implement fluent API for non-selecting SQL queries.

Some examples of the new SQLExec query syntax:

{code:java}
// insert
int inserted = SQLExec.query("INSERT INTO ARTIST (ARTIST_ID, ARTIST_NAME) VALUES (#bind($id),
#bind($name))").paramsArray(55, "a3").update(context);

// update
int updated = SQLExec.query("UPDATE ARTIST SET ARTIST_NAME = 'b3' WHERE ARTIST_NAME = 'a3'").update(context);
{code}

Also the plan is to use List<QueryResult> instead of our current ugly QueryResponse
in ObjectContext.


> SQLExec fluent query API
> ------------------------
>
>                 Key: CAY-2053
>                 URL: https://issues.apache.org/jira/browse/CAY-2053
>             Project: Cayenne
>          Issue Type: Improvement
>            Reporter: Dzmitry Kazimirchyk
>            Assignee: Dzmitry Kazimirchyk
>
> Implement fluent API for non-selecting SQL queries.
> Some examples of the new SQLExec query syntax:
> {code:java}
> // insert
> int inserted = SQLExec.query("INSERT INTO ARTIST (ARTIST_ID, ARTIST_NAME) VALUES (#bind($id),
#bind($name))").paramsArray(55, "a3").update(context);
> // update
> int updated = SQLExec.query("UPDATE ARTIST SET ARTIST_NAME = 'b3' WHERE ARTIST_NAME =
'a3'").update(context);
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message