scala slick metoda, której do tej pory nie rozumiem
Staram się zrozumieć niektóre śliskie prace i to, czego wymaga.
Oto przykład:
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 _)
}
Czy ktoś mógłby mi wyjaśnić, do czego służy*
metoda tutaj, co to jest<>
, czemuunapply
? a co to jest metoda projekcji~
'zwraca wystąpienieProjection2
?