光滑的提升表类型错误

时间:2013-12-12 05:17:14

标签: scala sbt slick

我只是将示例从github example复制到我的项目中后收到以下错误。我能够编译github示例项目。我觉得我一定是搞砸了一些人。我正在使用sbt 0.13

[error] .scala:13: too many arguments for constructor Object: ()Object
[error]   class Suppliers(tag: Tag) extends Table[(Int, String, String, String, String,   String)](tag, "SUPPLIERS") {
[error]                  ^
[error].scala:14: object column does not take type parameters.
[error]     def id = column[Int]("SUP_ID", O.PrimaryKey) // This is the primary key column

我的build.sbt看起来像

导入AssemblyKeys ._

name:=“myproject”

版本:=“1.0”

scalaVersion:=“2.10.3”

assemblySettings

seq(Revolver.settings:_ *)

libraryDependencies< + =(scalaVersion)(“org.scala-lang”%“scala-compiler”%_)

解析器+ =“Sonatype snapshots”位于“http://oss.sonatype.org/content/repositories/snapshots/

解析器+ =“Typesafe Repository”位于“http://repo.typesafe.com/typesafe/releases/

解析器+ =“Sonatype Releases”位于“http://oss.sonatype.org/content/repositories/releases

解析器+ =“CDH4”位于“https://repository.cloudera.com/artifactory/cloudera-repos/

解析器+ =“glassfish”位于“https://repository.jboss.org/nexus/content/repositories/glassfish

解析器+ =“喷雾回购”在“http://repo.spray.io

解析器+ =“anormcypher”在“http://repo.anormcypher.org/

libraryDependencies + =“com.typesafe.akka”%%“akka-actor”%“2.2.0”

libraryDependencies + =“com.typesafe.akka”%%“akka-testkit”%“2.2.0”

libraryDependencies + =“com.typesafe.akka”%%“akka-transactor”%“2.2.0”

libraryDependencies + =“io.spray”%“spray-can”%“1.2-RC2”

libraryDependencies + =“io.spray”%“spray-routing”%“1.2-RC2”

libraryDependencies + =“io.spray”%“spray-testkit”%“1.2-RC2”

libraryDependencies + =“io.spray”%%“spray-json”%“1.2.3”

libraryDependencies + =“org.scalatest”%“scalatest_2.10”%“1.9.2”

libraryDependencies + =“org.anormcypher”%%“anormcypher”%“0.4.4”

libraryDependencies + =“com.h2database”%“h2”%“1.3.166”

libraryDependencies + =“com.typesafe.slick”%%“slick”%“2.0.0-M3”

libraryDependencies + =“org.postgresql”%“postgresql”%“9.2-1002-jdbc4”

1 个答案:

答案 0 :(得分:5)

你的进口是错误的。好像你使用了一些工具根据他们的名字自动填充它们(或者你猜得很疯狂)。在任何情况下你导入错误的东西。只需导入

import scala.slick.driver.H2Driver.simple._

你已经定下来了。见http://slick.typesafe.com/doc/2.0.0-M3/gettingstarted.html#imports