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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -