我想DateTime
在 Slick 2.0 模型中使用。我使用jodatime:
我在以下位置添加了依赖项Build.scala
:
"joda-time" % "joda-time" % "2.3",
"org.joda" % "joda-convert" % "1.6"
然后我做:
class Comment(tag:Tag) extends Table[(Long, Int, Int, String, Int, DateTime)](tag,"Comment"){
def id=column[Long]("ID", O.PrimaryKey)
def rate=column[Int]("rate")
def sub=column[Int]("subject")
def content=column[Int]("cotent")
def user_ID=column[Int]("user")
def time=column[DateTime]("time") //-----------an error here
def * = (id, rate,sub, content, user_ID, time)
}
错误是:
could not find implicit value for parameter tm: scala.slick.ast.TypedType[org.joda.time.LocalDate]
我添加了 joda-convert jar,但它似乎不起作用。如何在 Slick 模型类中添加 DateTime?