scala - how to create update slick multiple row? -
i have code !! code insert multiple row..
def insertdocsetting(data: list[modeldocumentsetting]) = documentsettingtable ++= data
and update multiple row!!
def updatedocsetting(data: seq[modeldocumentsetting])= { (a <- data){ documentsettingtable.filter(_.doc_proc_list_id === a.doc_proc_list_id).update(a) } }
but ,i have problem result.. how create slick update multiple row
you need map result of filter tuple before can update it. can check how in documentation. like:
def updatedocsetting(data: seq[modeldocumentsetting])= { (a <- data){ documentsettingtable .filter(_.doc_proc_list_id === a.doc_proc_list_id) .map(doc => (doc.element1, doc.element2)) .update(("new element1", "new element2")) } }
Comments
Post a Comment