Domanda

I want to define a custom type in slick 2.0.0-M2. The type has an underlying scala type that is known to slick (for example String). In Slick 1.0.0 I could do something like:

class Test[UnderlyingType : TypeMapper] {
  case class MyType(elem: UnderlyingType)

  implicit val typeMapper = MappedTypeMapper.base[MyType, UnderlyingType](_.elem, t=>MyType(t))
}

(code above not tested, but my implementation was similar to that)

How does this work in slick 2.0.0-M2? The MappedTypeMapper class vanished...

È stato utile?

Soluzione

It is called MappedColumnType now. Also see https://groups.google.com/d/msg/scalaquery/4Ns_J_8wbqQ/0SGiJL4O8A8J

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top