1
votes

Looking to map java.sql.time to some joda time class. Having some issues with the mapper, it throws an error message. Has anyone performed this conversion?

trait DateMapper {
  implicit val DateMapper =
    MappedColumnType .base[java.sql.Time, org.joda.time.LocalTime] (
      d => new LocalTime(d.getTime))

}

Error

Unspecified value parameters: tcomap:(LocalTime) => Time
1
What's the error msg? - M.K.
Added the error message. - user2524908

1 Answers

3
votes

The issue is that you are missing the LocalTime => Time conversion for ResultSet -> Scala Collection conversion:

MappedColumnType.base[java.sql.Time, org.joda.time.LocalTime] (
  time => new LocalTime(time.getTime),
  localTime => new Time(localTime.toDateTimeToday().getMillis()))