anorm

SqlQuery

case class SqlQuery(query: String, argsInitialOrder: List[String] = immutable.this.List.empty[Nothing], queryTimeout: Option[Int] = scala.None) extends Sql with Product with Serializable

Initial SQL query, without parameter values.

Source
Anorm.scala
Linear Supertypes
Serializable, Serializable, Product, Equals, Sql, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SqlQuery
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Sql
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SqlQuery(query: String, argsInitialOrder: List[String] = immutable.this.List.empty[Nothing], queryTimeout: Option[Int] = scala.None)

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

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

    Definition Classes
    Any
  6. def apply()(implicit connection: Connection): Stream[Row]

    Executes this SQL statement as query, returns result as Row stream.

    Executes this SQL statement as query, returns result as Row stream.

    Definition Classes
    Sql
  7. val argsInitialOrder: List[String]

  8. def as[T](parser: ResultSetParser[T])(implicit connection: Connection): T

    Executes this statement as query and convert result as T, using parser.

    Executes this statement as query and convert result as T, using parser.

    Definition Classes
    Sql
  9. def asBatch[T]: BatchSql

  10. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  11. def asSimple[T](parser: RowParser[T] = defaultParser): SimpleSql[T]

    Prepares query as a simple one.

    Prepares query as a simple one.

    parser

    Row parser

    import anorm.{ SQL, SqlParser }
    
    SQL("SELECT 1").asSimple(SqlParser.scalar[Int])
  12. def clone(): AnyRef

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

    Definition Classes
    AnyRef
  14. def execute()(implicit connection: Connection): Boolean

    Executes this SQL statement.

    Executes this SQL statement.

    returns

    true if resultset was returned from execution (statement is query), or false if it executed update

    Definition Classes
    Sql
  15. def execute1(getGeneratedKeys: Boolean = false)(implicit connection: Connection): (PreparedStatement, Int)

    Definition Classes
    Sql
  16. def executeInsert[A](generatedKeysParser: ResultSetParser[A] = SqlParser.scalar[Long].singleOpt)(implicit connection: Connection): A

    Executes this SQL as an insert statement.

    Executes this SQL as an insert statement.

    generatedKeysParser

    Parser for generated key (default: scalar long)

    returns

    Parsed generated keys

    import anorm.SqlParser.scalar
    
    val keys1 = SQL("INSERT INTO Test(x) VALUES ({x})").
      on("x" -> "y").executeInsert()
    
    val keys2 = SQL("INSERT INTO Test(x) VALUES ({x})").
      on("x" -> "y").executeInsert(scalar[String].singleOpt)
    // ... generated string key
    Definition Classes
    Sql
  17. def executeQuery()(implicit connection: Connection): SqlQueryResult

    Executes this SQL query, and returns its result.

    Executes this SQL query, and returns its result.

    implicit val conn: Connection = openConnection
    val res: SqlQueryResult =
      SQL("SELECT text_col FROM table WHERE id = {code}").
      on("code" -> code).executeQuery()
    // Check execution context; e.g. res.statementWarning
    val str = res as scalar[String].single // going with row parsing
    Definition Classes
    Sql
  18. def executeUpdate()(implicit connection: Connection): Int

    Executes this SQL as an update statement.

    Executes this SQL as an update statement.

    returns

    Count of updated row(s)

    Definition Classes
    Sql
    Annotations
    @throws( "If statement is query not update" )
  19. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  21. def getFilledStatement(connection: Connection, getGeneratedKeys: Boolean = false): PreparedStatement

    Definition Classes
    SqlQuerySql
  22. final def isInstanceOf[T0]: Boolean

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

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

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

    Definition Classes
    AnyRef
  26. val query: String

  27. val queryTimeout: Option[Int]

  28. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  29. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. def withQueryTimeout(seconds: Option[Int]): SqlQuery

Deprecated Value Members

  1. def filledStatement(implicit connection: Connection): PreparedStatement

    Definition Classes
    Sql
    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.0) Use getFilledStatement or executeQuery

  2. def list[A](rowParser: RowParser[A])(implicit connection: Connection): Seq[A]

    Definition Classes
    Sql
    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.0) Use as with rowParser.*

  3. def parse[T](parser: ResultSetParser[T])(implicit connection: Connection): T

    Definition Classes
    Sql
    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.0) Use as

  4. def single[T](rowParser: RowParser[T])(implicit connection: Connection): T

    Definition Classes
    Sql
    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.0) Use as with rowParser.single

  5. def singleOpt[T](rowParser: RowParser[T])(implicit connection: Connection): Option[T]

    Definition Classes
    Sql
    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.0) Use as with rowParser.singleOpt

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Sql

Inherited from AnyRef

Inherited from Any

Ungrouped