cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: Extract generated keys from SqlExec
Date Thu, 21 Jun 2018 14:03:07 GMT
Hi Bob,

Unfortunately this is not possible now (at least not in an easy way).

I think that would be a good addition to Cayenne though. E.g. "SqlExec.returnGenerationKeys()"
method would ensure that we request keys from JDBC, and add them to the returned result. 

I put it on my private list of ideas, and of course if anyone wants to jump on it right away,
you'd be very welcome :)

Andrus


> On Jun 18, 2018, at 11:56 PM, Bob Schellink <sabob1@gmail.com> wrote:
> 
> Hi all,
> 
> SqlExec can be used to perform insert queries, but is it possible to
> retrieve the generated keys?
> 
> In JDBC one would do:
> stmt.executeUpdate( "INSERT INTO...", Statement.RETURN_GENERATED_KEYS);
> rs = stmt.getGeneratedKeys();
> 
> I'm looking at using a mapping-free Cayenne runtime to perform JDBC
> operations.
> 
> Kind regards
> 
> Bob


Mime
View raw message