Slick left outer join fetching whole joined row as option

后端 未结 3 1871
伪装坚强ぢ
伪装坚强ぢ 2021-02-03 10:48

My join looks like this:

def byIdWithImage = for {
    userId <- Parameters[Long]
    (user, image) <- Users leftJoin RemoteImages on (_.imageId === _.id)          


        
3条回答
  •  野性不改
    2021-02-03 11:15

    I integrated helpers for this in my play-slick example app, which allow you to just call image.?

    See the .? calls, the definition of ? and the definition of mapOption.

提交回复
热议问题