wsql.ResultSetMapper
See theResultSetMapper companion object
any record level(a table row) having a ResultSetMapper context bound can used in rows[T](sql)
the scala-sql library provide a Macro to automate generate the implementation for a given case class T if all it's field is JdbcValueAccess-able(having a JdbcValueAccess context bound).
since the macro will generate a ResultSetMapper class for you anytime if there is not an explicit imported implicit value, maybe a lot of anonymous class will be generated. that is no problem but a bigger jar. to avoid this problem, you can define a implicit ResultSetMappper value in the Case Class's companion object.
case class User(name: String, age: Int) object User { implicit val resultSetmapper = ResultSetMapper.material[User] }
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object _rsm_bd.typeobject _rsm_bd0.typeobject _rsm_date.typeobject _rsm_date0.typeobject _rsm_ts_0.typeobject given_ResultSetMapper_Boolean.typeobject given_ResultSetMapper_Byte.typeobject given_ResultSetMapper_Double.typeobject given_ResultSetMapper_Float.typeobject given_ResultSetMapper_Int.typeobject given_ResultSetMapper_Long.typeobject given_ResultSetMapper_Short.typeobject given_ResultSetMapper_|.typeobject resultSetMapper.type
Members list
In this article