import scala.slick.driver.JdbcProfile
trait Profile {
val profile: JdbcProfile
}
trait TableComponent extends Profile {
abstract class PowerTable[ID <: TypedId, E <: Entity[ID]](tag:Tag, tableName: String)
extends Table[E](tag, tableName) with HasId[ID] {
}
trait HasId[ID <: TypedId] {
self: Table[_] =>
protected val idColumnName = "id"
implicit val idMapper: MappedColumnType[ID, Long]
def id = column[ID](idColumnName, O.AutoInc, O.NotNull)
}
}
trait AccountTable {
self: TableComponent =>
import profile.simple._
val accountQuery = TableQuery[Accounts]
class Accounts(tag:Tag) extends PowerTable[AccountId, Account](tag, "accounts")
with HasId[AccountId] {
/* Error:
- could not find implicit value for evidence parameter of type scala.slick.ast.BaseTypedType[AccountId]
- could not find implicit value for evidence parameter of type scala.slick.jdbc.JdbcType[Long]
- not enough arguments for method base: (implicit evidence$1: scala.reflect.ClassTag[com.paguemob.gateway.model.AccountId], implicit evidence$2: scala.slick.jdbc.JdbcType[Long])scala.slick.jdbc.JdbcType[AccountId] with scala.slick.ast.BaseTypedType[AccountId]. Unspecified value parameter evidence$2.
*/
implicit val idMapper = MappedColumnType.base[AccountId, Long](
i => i.id,
l => AccountId(l)
)
def create = Account.apply _
def extrator = Account.unapply _
def email = column[String]("email", O.NotNull)
def * = (email, id.?) <> ( create.tupled, extrator)
}
}
Looks to me like some Specs2 code has crept in here, based on the "evidence parameter" mention in the error. It isn't apparent from the listing how that is happening, but it might be a clue for you.
--
---
You received this message because you are subscribed to the Google Groups "Slick / ScalaQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalaquery+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Looks to me like some Specs2 code has crept in here, based on the "evidence parameter" mention in the error. It isn't apparent from the listing how that is happening, but it might be a clue for you.
--