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 <sab...@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

Reply via email to