Migrating to anorm2.4 (with play 2.4): ToStatement[T] and ToStatement[Option[T]]

前端 未结 1 651
甜味超标
甜味超标 2021-01-23 03:29

Up until the anorm included with play 2.3, I could write the following:

implicit val arbitraryClassToStatement = new ToStatement[ArbitraryClass] {
  def set( 
          


        
1条回答
  •  后悔当初
    2021-01-23 04:03

    You need to create a ParameterMetaData[ArbitraryClass] for this to work

    implicit object ArbitraryClassMetaData extends ParameterMetaData[ArbitraryClass] {
      val sqlType = ParameterMetaData.StringParameterMetaData.sqlType
      val jdbcType = ParameterMetaData.StringParameterMetaData.jdbcType 
    }
    

    Here I just retook the values of ParameterMetaData[String]

    0 讨论(0)
提交回复
热议问题