I have run your test case against PostgreSQL, MySQL, Derby, HSQLDB,
and H2. Both PostgreSQL and HSQLDB don't support getGeneratedKeys. The
behavior of Derby is the same as H2. MySQL does support what you have
described. Do you know if this is supported by other databases? I will
add this feature to the roadmap, but don't plan to implement it in the
near future. The documentation of getGeneratedKeys is already correct,
it says: "Return a result set that contains the last generated
autoincrement key for this connection... return the result set with
one row and one column containing the key"
Regards,
Thomas
The postgres lets me do:
select nextval('sequencename') from (select generate_series(1,?)) as temp;
to get 10 ids in a single statement. Very nifty.
Thomas, is there an analogous way to project a set of rows in H2?
> select nextval('sequencename') from (select generate_series(1,?)) as temp;
In H2, you could do this:
create sequence sequencename;
select next value for sequencename from system_range(1, 100);
Unfortunately, system_range doesn't support parameters at the moment.
I will fix this for the next release.
Regards,
Thomas