Here is the thread :
http://groups.google.com/group/squeryl/browse_thread/thread/76edf4f191c489b0There are two strategies for auto increment generation on the database side :
1) auto increment as a behavior of the column (MySQL, MSSQL, H2)
2) the use if a sequence object (Oracle, DB2, Postgres)
In order to fetch the DB generated keys, it is nice to be able to do it in the same database roundtrip as
the insert call.
for (1) there is a JDBC feature getGeneratedKeys, see :
http://download.oracle.com/javase/6/docs/api/java/sql/Statement.html#getGeneratedKeys%28%29
In theory it should work also with bulk insert, I'm hoping that it does, but havent tried it yet.
for (2) most likely the best that can be done is with two database trips, *but only if* there is a way to get
multiple "nextvals" to the sequence (in a single DB call) :
http://forums.oracle.com/forums/thread.jspa?threadID=1113582
let ROW_COUNT be the number of rows in the bulk insert
i) val pks = "get ROW_COUNT PKs from the sequenec"
ii) assign(pks) to the iterable of object to insert
iii) do a normal bulk insert...
As you can see, it will be harder to implement for database that use sequences, I wish there was something like :
val pks = "select mySequence.nextVals(N) from dual"
which would return a list of PKs
So to answer the question : it isn't implemented yet, and there is a bit of reaseach to be done,
for databases like oracle, postgres, and BD2..
Cheers