Reputation: 28676
I'm trying to use Slick's mapped projections (Version 1.0.0-RC1). But the following code, which follows the examples on the website (as there doesn't seem to be any proper documentation nor usable scaladocs) yields a type error:
object PDFDocs extends Table[(String,Option[String],String)]("DOCUMENTS"){
def id = column[String]("ID", O.PrimaryKey)
def title = column[Option[String]]("TITLE")
def tags = column[String]("TAGS")
def * = (id ~ title ~ tags).<>[PDFDocument](PDFDocument,PDFDocument unapply _)
}
case class PDFDocument(name: String,
title: Option[String],
tags: String)
Here is the produced error:
error: type mismatch;
found: scala.slick.lifted.MappedProjection[docman.rdb.PDFDocument,(String,Option[String], String)]
required: scala.slick.lifted.ColumnBase[(String, Option[String], String)]
def * = (id ~ title ~ tags).<>[PDFDocument](PDFDocument,PDFDocument unapply _)
Upvotes: 1
Views: 1654
Reputation:
Off the top of my head, shouldn't the first line be:
object PDFDocs extends Table[PDFDocument]("DOCUMENTS") {
Upvotes: 9