Trait/Object

anorm

Row

Related Docs: object Row | package anorm

Permalink

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
Visibility
  1. Public
  2. All

Value Members

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. def apply[B](position: Int)(implicit c: Column[B]): B

    Permalink

    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

    Permalink

    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]

    Permalink

    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

    Permalink
    Definition Classes
    Any
  8. lazy val asList: List[Any]

    Permalink

    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]

    Permalink

    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

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

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

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

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  21. def toString(): String

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped