implicits not found/working - Long to java.sql.Timestamp, Long to java.sql.Date

76 views
Skip to first unread message

RanUser

unread,
Nov 12, 2015, 6:51:05 AM11/12/15
to Slick / ScalaQuery
Slick 2.1

My case classes use Longs instead of java.sql.Timestamp or java.sql.Date

Queries in Slick throw errors like this (Postgres is db):

org.postgresql.util.PSQLException: ERROR: operator does not exist: timestamp with time zone >= bigint
  Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
  Position: 325

I have believe I have the implicits defined correctly and their imported in the proper places:

implicit val LongToTimestamp = MappedColumnType.base[Long, Timestamp](
  longTS
=> new Timestamp(longTS),
  sqlTS
=> sqlTS.getTime
)

implicit val LongToDate = MappedColumnType.base[Long, java.sql.Date](
  longTS
=> new java.sql.Date(longTS),
   sqlDate
=> sqlDate.getTime
)


What's wrong?  I have implicits for other tables working that convert between JodaTime.DateTime / LocalDate and the SQL counterparts.   Completely stuck on this one...

Thank you

RanUser

unread,
Nov 12, 2015, 1:22:07 PM11/12/15
to Slick / ScalaQuery
Forgot to add, this is Scala 2.11.7
Reply all
Reply to author
Forward
0 new messages