相关疑难解决方法(0)

斯卡拉光滑的方法到目前为止我无法理解

我尝试了解一些Slick的作品以及它需要什么.

这是一个例子:

package models

case class Bar(id: Option[Int] = None, name: String)

object Bars extends Table[Bar]("bar") {
  def id = column[Int]("id", O.PrimaryKey, O.AutoInc)

  // This is the primary key column
  def name = column[String]("name")

  // Every table needs a * projection with the same type as the table's type parameter
  def * = id.? ~ name <>(Bar, Bar.unapply _)
}
Run Code Online (Sandbox Code Playgroud)

有人可以解释一下*这里方法的目的是什么<>,为什么unapply?什么是Projection - 方法~'返回实例Projection2

scala magic-methods scalaquery playframework-2.0 slick

88
推荐指数
2
解决办法
2万
查看次数

为什么scala函数限制为22个参数?

并不是说我实际上接近这个限制,但我总是想知道:为什么他们停在Function22/ Tuple22.JVM限制?任意选择?

scala

35
推荐指数
5
解决办法
2万
查看次数