anorm

Row

Related Docs: object Row | package anorm

trait Row extends AnyRef

Source
Row.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Row
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. 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: (String, String) = SQL("SELECT * FROM Test").map(row =>
      row(1) -> row(2) // string columns #1 and #2
    )
  5. 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: (String, String) = SQL("SELECT * FROM Test").map(row =>
      row("code") -> row("label") // string columns 'code' and 'label'
    )
  6. def as[T](parser: RowParser[T]): Try[T]

    Returns row as T.

    Returns row as T.

    import anorm.SqlParser.{ int, str }
    
    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

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. 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
    val l: List[Any] = row.asList
    // l == List[Any]("str", 2)
    See also

    #as

  9. 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
    val m: Map[String, Any] = row.asMap
    // l == Map[String, Any]("table.A" -> "str", "table.B" -> 2)
    See also

    #as

  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  20. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  21. def toString(): String

    Definition Classes
    AnyRef → Any
  22. def unsafeGet[T](rowparser: ⇒ RowParser[T]): T

    Annotations
    @inline()
  23. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped