trait Row extends AnyRef
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- Row
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply[B](position: Int)(implicit c: Column[B]): B
Returns parsed column.
Returns parsed column.
- position
Column position from 1 to n
- c
Column mapping
import anorm._, Column.columnToString // mapping column to string val res = SQL("SELECT * FROM Test").map { row => row(1) -> row(2) // string columns #1 and #2 }
-
def
apply[B](name: String)(implicit c: Column[B]): B
Returns parsed column.
Returns parsed column.
- name
Column name
- c
Column mapping
import anorm._, Column.columnToString // mapping column to string val res = SQL("SELECT * FROM Test").map { row => // string columns 'code' and 'label' row[String]("code") -> row[String]("label") }
-
def
as[T](parser: RowParser[T]): Try[T]
Returns row as
T
.Returns row as
T
.import anorm._, SqlParser.{ int, str } def foo(implicit con: java.sql.Connection) = { val parseOnlyFirstRow = SQL"SELECT * FROM Table".withResult(_.map(_.row.as( str("foo") ~ int(2) map { case a ~ b => b -> a }))) // Either[List[Throwable], Option[Try[(Int, String)]]] val optionalParseRes = parseOnlyFirstRow.right.map(_.flatMap(_.toOption)) // Either[List[Throwable], Option[(Int, String)]] }
- parser
Row parser
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
lazy val
asList: List[Any]
Returns row as list of column values.
Returns row as list of column values.
// Row first column is string "str", second one is integer 2 def l(row: anorm.Row): List[Any] = row.asList // l == List[Any]("str", 2)
- See also
#as
-
lazy val
asMap: Map[String, Any]
Returns row as dictionary of value per column name
Returns row as dictionary of value per column name
// Row column named 'A' is string "str", column named 'B' is integer 2 def m(row: anorm.Row): Map[String, Any] = row.asMap // l == Map[String, Any]("table.A" -> "str", "table.B" -> 2)
- See also
#as
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
unsafeGet[T](rowparser: ⇒ RowParser[T]): T
- Annotations
- @inline()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()