anorm

SqlQuery

class SqlQuery 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)

    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.2) Do not use the SqlQuery constructor directly because it does not parse the query. Use SQL(...) instead.

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 canEqual(that: Any): Boolean

    Definition Classes
    SqlQuery → Equals
  13. def clone(): AnyRef

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

    Definition Classes
    AnyRef
  15. def equals(obj: Any): Boolean

    Definition Classes
    SqlQuery → Equals → AnyRef → Any
  16. 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
  17. def execute1(getGeneratedKeys: Boolean = false)(implicit connection: Connection): (PreparedStatement, Int)

    Definition Classes
    Sql
  18. 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
  19. 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
  20. 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" )
  21. def finalize(): Unit

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

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

    Definition Classes
    SqlQuerySql
  24. def hashCode(): Int

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

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

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

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

    Definition Classes
    AnyRef
  29. def productArity: Int

    Definition Classes
    SqlQuery → Product
  30. def productElement(n: Int): Any

    Definition Classes
    SqlQuery → Product
  31. def productIterator: Iterator[Any]

    Definition Classes
    Product
  32. def productPrefix: String

    Definition Classes
    SqlQuery → Product
  33. val query: String

  34. val queryTimeout: Option[Int]

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

    Definition Classes
    AnyRef
  36. def toString(): String

    Definition Classes
    SqlQuery → AnyRef → Any
  37. final def wait(): Unit

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

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

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

Deprecated Value Members

  1. def copy(query: String = this.query, argsInitialOrder: List[String] = this.argsInitialOrder, queryTimeout: Option[Int] = this.queryTimeout): SqlQuery

    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.2) SqlQuery will become a trait in 2.4.0

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

    Definition Classes
    Sql
    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.0) Use getFilledStatement or executeQuery

  3. 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.*

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

    Definition Classes
    Sql
    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.0) Use as

  5. 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

  6. 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