Skip to content
Permalink
Browse files

Fix forceInsertAll for single argument

  • Loading branch information...
zczapran committed Aug 12, 2014
1 parent f0bc906 commit b0b02526bc40350f48718977a5972f025b13e3ca
@@ -112,6 +112,8 @@ class InsertTest extends TestkitTest[JdbcTestDB] {
ts.forceInsert(104, "A")
ts.map(_.ins).forceInsertAll((105, "B"), (106, "C"))
assertEquals(3, ts.filter(_.id > 100).length.run)
ts.map(_.ins).forceInsertAll((111, "D"))
assertEquals(4, ts.filter(_.id > 100).length.run)
}
}

@@ -189,7 +189,8 @@ trait JdbcInsertInvokerComponent extends BasicInsertInvokerComponent{ driver: Jd
final def forceInsertAll(values: U*)(implicit session: Backend#Session): MultiInsertResult = internalInsertAll(compiled.forceInsert, values: _*)

protected def internalInsertAll(a: compiled.Artifacts, values: U*)(implicit session: Backend#Session): MultiInsertResult = session.withTransaction {
if(!useBatchUpdates || (values.isInstanceOf[IndexedSeq[_]] && values.length < 2)) retMany(values, values.map(insert))
if(!useBatchUpdates || (values.isInstanceOf[IndexedSeq[_]] && values.length < 2))
retMany(values, values.map(v => internalInsert(a, v)))
else preparedInsert(a.sql) { st =>
st.clearParameters()
for(value <- values) {

0 comments on commit b0b0252

Please sign in to comment.
You can’t perform that action at this time.