首页 > 解决方案 > 为什么我无法从 slick 官方文档中找到类 Table 的定义?

问题描述

我想找到类表的定义:

final class MessageTable(tag: Tag)
  extends Table[Message](tag, "message")

我只能通过官方文档找到此表:https ://scala-slick.org/doc/3.3.3/api/index.html#slick.model.Table

case classTable(name: QualifiedName, columns: Seq[Column], primaryKey: Option[PrimaryKey], foreignKeys: Seq[ForeignKey], indices: Seq[Index], options: Set[TableOption[_]] = Set()) extends Product with Serializable

作为文档,它是在 scala.model 中定义的案例类

但是当使用 Idea 查找表的定义时,使用示例代码,它在 RelationalProfile.scala 中定义:

abstract class Table[T](_tableTag: Tag, _schemaName: Option[String], _tableName: String) extends AbstractTable[T](_tableTag, _schemaName, _tableName)

那么为什么我在官方文档中找不到定义?因为它是抽象的?但是类表中的所有方法都已定义(def xxx =),所以我认为类表不需要是抽象的

谢谢!

标签: scalaslick

解决方案


推荐阅读