You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Koka Kiknadze <22...@gmail.com> on 2008/04/18 09:38:09 UTC

Inserting lists

Yesterday I understood that I'm writing loops to insert a lists of objects
way too often.

I think implementing methods like:

insertList("insertSingleSomeObject",List<SomeObject>)    (with
"insertSingleSomeObject" beeing sqlmap entry for inserting single object)
batchInsert("insertSingleSomeObject",List<SomeObject>)  (with batch size
configurable like row prefetch is)

updateList("insertSingleSomeObject",List<SomeObject>)
batchUpdate("insertSingleSomeObject",List<SomeObject>)

would be quite straightforward.

Think it will make API more bidirectional, see, we have queryForList, i.e.
getting list of objects in a single call, so it's quite natural to expect
that one should be able to persist the list in a single call.

Wonder what others think about it.

Nicholoz Koka Kiknadze