我在光滑的连接查询但是当我加入 Addresses
表时,连接的条件需要 UserSettings
(ust)但我无法从'get'函数获取该表 . getOrElse
返回正确的表但是要在函数参数中传递什么 .
它会生成以下错误
No matching Shape found.
Slick does not know how to map the given types.
Possible causes: T in Table[T] does not match your * projection. Or you use an unsupported type in a Query (e.g. scala List).
Required level: slick.lifted.FlatShapeLevel
Source type: Int
Unpacked type: Any
Packed type: P2
这是我的Slick查询
var queryTest = Users.drop((pageNo - 1) * noOfItemsPerPage).take(noOfItemsPerPage).joinLeft(UserStatesOfInterest).on {
case (usr, usi) => (usr.id === usi.userId)
} .joinLeft(UserImpactAreas).on {
case ((usr, usi), uia) => (usr.id === uia.userId)
} .joinLeft(UserSettings).on {
case (((usr, usi), uia), ust) => (usr.id === ust.userId)
}.joinLeft(Addresses).on {
case ((((usr, usi), uia), ust), adr) => (ust.getOrElse(0).contactAddress === adr.id)
}