【发布时间】:2013-02-20 21:33:41
【问题描述】:
我的加入看起来像这样:
def byIdWithImage = for {
userId <- Parameters[Long]
(user, image) <- Users leftJoin RemoteImages on (_.imageId === _.id) if user.id === userId
} yield (user, image)
但当 user.imageId 为 null 时,slick 在运行时会失败
[SlickException: 读取 RemoteImage.url 列的 NULL 值]
将产量改为
} yield (user, image.?)
给我一个编译时异常,它只适用于个别列
找不到 scala.slick.lifted.TypeMapper[image.type] 类型的证据参数的隐含值
会有不同的方法来完成我在这里尝试做的事情吗? (在单个查询中)
【问题讨论】:
-
在 slick 2.0 中修复了一半 => slick.typesafe.com/talks/2013-12-03_Scala-eXchange/…
标签: scala left-join option slick