异常 joda-time - localdatetime 支持
anorm joda-time - localdatetime support
使用 Anorm 2.5.2
SQL(s"insert into user (name, registered_date) values ({name},{registered_date})").on(
'name -> user.name,
'registered_date -> user.registeredDate
).executeInsert()
编译错误:
Error:(72, 24) type mismatch; found : (Symbol,
org.joda.time.LocalDateTime) required: anorm.NamedParameter
'registered_date -> user.registeredDate
我应该包括一些隐式的时间->行转换,还是它应该与异常一起开箱即用?
哪里的用户:
case class User(id: Option[Long] = None,
name: String,
registeredDate: LocalDateTime // joda-time'
)
import anorm.JodaParameterMetaData._
从这里开始:https://groups.google.com/forum/#!topic/play-framework/I6TnTzO5MUw
(自言自语很愉快 :))
使用 Anorm 2.5.2
SQL(s"insert into user (name, registered_date) values ({name},{registered_date})").on(
'name -> user.name,
'registered_date -> user.registeredDate
).executeInsert()
编译错误:
Error:(72, 24) type mismatch; found : (Symbol, org.joda.time.LocalDateTime) required: anorm.NamedParameter 'registered_date -> user.registeredDate
我应该包括一些隐式的时间->行转换,还是它应该与异常一起开箱即用?
哪里的用户:
case class User(id: Option[Long] = None,
name: String,
registeredDate: LocalDateTime // joda-time'
)
import anorm.JodaParameterMetaData._
从这里开始:https://groups.google.com/forum/#!topic/play-framework/I6TnTzO5MUw
(自言自语很愉快 :))