Slick 2.x filter on mapped column type (java.util.Date)

I am using java.util.Date in the model class. Since Slick doesn't support juDate out of the box, I've added an implicit mapping implicit val dateColumnMapper = MappedColumnType.base[Date, SqlDate](d => new SqlDate(d.getTime), d => d)

to my Table class for example .

But now I'm stuck in the filter by date: proposalsQuery.filter(_.since >= since)

. I've tried different options, but I always get compilation errors:value >= is not a member of scala.slick.lifted.Column[java.util.Date]

Since I am new to Scala / Slick working examples with simple explanation of the problem would be much appreciated.

Thank!

+3


source to share


2 answers


the implicit mapper MUST be available at the location where you write your filter request.



+3


source


you have to import this into your file

import com.github.tototoshi.slick.JdbcJodaSupport._



and this is a library "com.github.tototoshi" %% "slick-joda-mapper" % "1.2.0"

0


source







All Articles