I use slick 2.0.2, and I just want to make a simple filter or use a helper operator, I just want to do logical operations like "and", "or" and "not" inside the filter:
val subjectdata = TableQuery[SubjectTable]
...
subjectdata.where(i=>(i.id===id && i.userId===rs.user.get.identityId.userId)).list()
and get the error:
[error] G:\testprojects\slickplay\app\controllers\ShopController.scala:89: Cannot perform option-mapped operation
[error] with type: (Long, String) => R
[error] for base type: (Long, Long) => Boolean
[error] subjectdata.where(i=>(i.id===id && i.userId===rs.user.get.identityId
.userId)).list()
[error]
^
In slick 1.0.1, I can do:
val results = Query(TableClass)
.filter(r => r.isNull || r.expires > new Timestamp(DateTime.now().getMillis()))
.list
I want to do something like this in TableQuery in Slick2. How to do it?
source
share