我正在研究一个用Scala编写的程序的案例类,Play 2.1.1和PlaySlick作为数据库映射器.该申请涉及引用.我们有一个包含22个字段的引用表,因此我们将这些范围缩小到22,我们确实需要做大多数事情.代码如下:
package models
import play.api.db.slick.Config.driver._
case class Citation(citation_id: Int, pubtype: String, abs: String, keywords: String,
doi: String, url: String, booktitle: String, chapter: String, edition: String, editor:
String, translator: String, journal: String, month: String, number: String, pages:
String, publisher: String, location: String, title: String, volume: String, year:
String, raw: String, owner: String)
object Citations extends Table[Citation]("citations") {
def citation_id = column[Int]("citation_id", O.PrimaryKey, O.AutoInc)
def pubtype = column[String]("pubtype")
def abs = column[String]("abstract")
def keywords = column[String]("keywords")
def doi = …Run Code Online (Sandbox Code Playgroud)