我在浏览器中有一个连接查询,但是当我加入Addresses
表时,加入条件需要UserSettings
(ust),但我无法从'得到'功能。 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)
}