Hi! You could try : ((authors.fold(create.insertInto(AUTHOR,AUTHOR.ID, AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME)))(insertValues, value=> insertValues.values(value.id, value.firstName, value.lastName))).execute
On Mon, May 20, 2013 at 8:24 AM, Christopher Martin <[email protected]>wrote: > The docs give a lot of examples for doing INSERTs with some fixed number > of tuples, such as: > > create.insertInto(AUTHOR, >> AUTHOR.ID, AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME) >> .values(100, "Hermann", "Hesse") >> .values(101, "Alfred", "Döblin"); > > > But what about the case where I have some arbitrary-length collection of > objects? Say for instance I'm using a class > > case class Author(id: Int, firstName: String, lastName: String) > > > And I now have a Seq[Author] and want to insert them all in one query. > How would you go about writing that? > > -- > You received this message because you are subscribed to the Google Groups > "jOOQ User Group" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
