0

Im using Squeryl with the function inhibitWhen to ignore a Where clause when a scala value is Empty. I tried this code but Squeryl still checking for the where clause that i want to ignore!

(l.book_id in params.get("book_id").toList.flatMap(_.split(",")).map(_.toInt)).inhibitWhen(params.get("book_id").map(_.isEmpty) == Some(true))

So what i need to do is when book_id has some values (1,4,6) it use the in clause but when it's empty the in clause should be ignored !

user708683
  • 500
  • 3
  • 9
  • 26

0 Answers0