有案例类+光滑的表映射。
许多类使用相同的字段,例如
class T1(tag: Tag) extends Table[caseClassA](tag, "A") {
def id = column[Option[Long]]("ID", O.PrimaryKey, O.AutoInc)
def id1 = column[Long]("ID1", O.NotNull)
def id2 = column[String]("ID2", O.NotNull)
def idn = column[String]("IDn", O.NotNull)
}
class T2(tag: Tag) extends Table[caseClassB](tag, "B") {
def id = column[Option[Long]]("ID", O.PrimaryKey, O.AutoInc)
def id1 = column[Long]("ID1", O.NotNull)
def id2 = column[String]("ID2", O.NotNull)
def idn = column[String]("IDn", O.NotNull)
}
我怎样才能移动id, id1, id2, idn
到根线程?
试过了
trait BasicT extends Table {
...
}
没有成功,有什么想法吗?
BR!