ResultSetMapper

wsql.ResultSetMapper
See theResultSetMapper companion object
trait ResultSetMapper[T]

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 Object
trait Matchable
class Any
Known subtypes
object _rsm_bd.type
object _rsm_bd0.type
object _rsm_date.type
object _rsm_date0.type
object _rsm_ts_0.type
object resultSetMapper.type
Show all

Members list

Value members

Abstract methods

def from(rs: ResultSet): T