2016-09-28 3 views
0

Wie erreichen Sie das Äquivalent in Slick?Wo Zustand in Slick

select * from table1 where col1 = 1 AND (col2 = 2 or col3 = 3) 

arbeiten Dies gilt nicht:

val action = table.filter(_.col1 === 1 && (_.col2 === 2 || _.col3 === 3)).result 

Antwort

2

Sie nicht die kurze Hand in diesem Fall verwenden können. Versuchen Sie dies:

val action = table.filter(x => x.col1 == 1 && (x.col2 == 2 || x.col3 == 3)).result 
+0

Übrigens, das funktioniert mit '===' anstelle von '==' – ps0604