我无法找到解决此问题的方法:
这个特性:
trait BasicRepository[Schema <: Table[Entity] with Identifiable[Entity], Entity]
而且:
trait ProfilePartRepository[Schema <: Table[Entity] with ProfilePart[Entity], Entity]
这个对象:
object PhoneNumberRepository extends BasicRepository[PhoneNumbers, PhoneNumber] with ProfilePartRepository[PhoneNumbers, PhoneNumber] {
这个方法:
def insertProfilePart[Schema <: Table[Entity] with Identifiable[Entity], Entity](repository: BasicRepository[Schema, Entity], entities: Seq[Entity]) : Seq[Future[Int]]
该方法无法编译。但我认为你可以看到我想要实现的目标。签名必须是什么样的?
编辑:其实我并不关心&#34; Schema&#34;在方法中,它只需要是一个有效的BasicRepository。EDIT2:编译错误(调用方法时,AgnosticDriver.api为slick.driver.JdbcDriver):
inferred type arguments [persistence.slickSchemas.PhoneNumbers,Product with Serializable] do not conform to method insertProfilePart's type parameter bounds [Schema <: persistence.AgnosticDriver.api.Table[Entity] with persistence.slickSchemas.Identifiable[Entity],Entity]
答案 0 :(得分:0)
非常感谢您的评论。我太愚蠢了,无法思考容易失败的事情。
我刚刚将错误的参数传递给&#34; insertProfilePart&#34; ......