我想在光滑的2.0.0-M2中定义自定义类型。该类型具有已知为平滑的基础scala类型(例如String)。在Slick 1.0.0中,我可以执行以下操作:
class Test[UnderlyingType : TypeMapper] {
case class MyType(elem: UnderlyingType)
implicit val typeMapper = MappedTypeMapper.base[MyType, UnderlyingType](_.elem, t=>MyType(t))
}
(以上代码未经测试,但我的实现与此类似)
在光滑的2.0.0-M2中如何工作?MappedTypeMapper类消失了...
现在被称为MappedColumnType
。另请参阅https://groups.google.com/d/msg/scalaquery/4Ns_J_8wbqQ/0SGiJL4O8A8J
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句