为什么映射到提升查询中的List会失败" Slick不知道如何映射给定类型。"?

时间:2015-01-05 00:20:37

标签: slick-2.0

我试图在Slick提升的查询中映射到List,我收到编译错误:

No matching Shape found.
[error] Slick does not know how to map the given types.
[error] Possible causes: T in Table[T] does not match your * projection. Or you use an unsupported type in a Query (e.g. scala List).
[error]   Required level: scala.slick.lifted.FlatShapeLevel
[error]      Source type: Seq[String]
[error]    Unpacked type: T
[error]      Packed type: G

为什么在非Slick地图操作中,我可以映射到任何类型,而在Slick查询中,我可以映射到简单的Scala类型,但不能映射到Scala List

1 个答案:

答案 0 :(得分:0)

尝试

import slick.driver.(yourDB)Driver.api._