sealed trait ToStatementPriority0 extends AnyRef
- Alphabetic
- By Inheritance
- ToStatementPriority0
- AnyRef
- Any
- Hide All
- Show All
- 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
-
implicit
def
arrayToParameter[A <: AnyRef](implicit m: ParameterMetaData[A]): ToStatement[Array[A]] with NotNullGuard
Sets an array parameter on statement (see
java.sql.Array
).Sets an array parameter on statement (see
java.sql.Array
).SQL("INSERT INTO Table(arr) VALUES {a}").on("a" -> Array("A", "2", "C"))
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
implicit
def
binaryStreamToStatement[S <: InputStream]: ToStatement[S]
Sets a binary stream as parameter on statement.
Sets a binary stream as parameter on statement. For
null
value,setNull
withLONGVARBINARY
is called on statement.SQL("INSERT INTO Table(bin) VALUES {b}").on("b" -> inputStream)
-
implicit
def
blobToStatement[B <: Blob]: ToStatement[B]
Sets a blob as parameter on statement.
Sets a blob as parameter on statement. For
null
value,setNull
withBLOB
is called on statement.val blob = con.createBlob() blob.setBytes(1, byteArray) SQL("INSERT INTO Table(bin) VALUES {b}").on("b" -> blob)
-
implicit
def
characterStreamToStatement[R <: Reader]: ToStatement[R]
Sets a character stream as parameter on statement.
Sets a character stream as parameter on statement. For
null
value,setNull
withVARCHAR
is called on statement.SQL("INSERT INTO Table(chars) VALUES {c}").on("c" -> reader)
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.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
-
implicit
def
listToStatement[A](implicit c: ToStatement[A]): ToStatement[List[A]]
Sets multi-value parameter from list on statement.
Sets multi-value parameter from list on statement.
SQL("SELECT * FROM Test WHERE cat IN ({categories})"). on('categories -> List(1, 3, 4)
-
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()
-
implicit
def
optionToStatement[A](implicit c: ToStatement[A], meta: ParameterMetaData[A]): ToStatement[Option[A]] with NotNullGuard
Sets optional A inferred as Option[A].
Sets optional A inferred as Option[A].
SQL("SELECT * FROM Test WHERE category = {c}").on('c -> Option("cat")) SQL"SELECT * FROM Test WHERE nullable_int = \${Option.empty[Int]}"
-
implicit
def
seqParamToStatement[A](implicit c: ToStatement[Seq[A]]): ToStatement[SeqParameter[A]] with NotNullGuard
Sets multi-value parameter on statement, with custom formatting (using SeqParameter).
Sets multi-value parameter on statement, with custom formatting (using SeqParameter).
import anorm.SeqParameter SQL("SELECT * FROM Test t WHERE {categories}"). on('categories -> SeqParameter( values = Seq("a", "b", "c"), separator = " OR ", pre = "EXISTS (SELECT NULL FROM j WHERE t.id=j.id AND name=", post = ")"))
-
implicit
def
seqToStatement[A](implicit c: ToStatement[A]): ToStatement[Seq[A]]
Sets multi-value parameter from sequence on statement.
Sets multi-value parameter from sequence on statement.
SQL("SELECT * FROM Test WHERE cat IN ({categories})"). on('categories -> Seq("a", "b", "c")
-
implicit
def
setToStatement[A](implicit c: ToStatement[A]): ToStatement[Set[A]]
Sets multi-value parameter from set on statement.
Sets multi-value parameter from set on statement.
SQL("SELECT * FROM Test WHERE cat IN ({categories})"). on('categories -> Set(1, 3, 4)
-
implicit
def
someToStatement[A](implicit c: ToStatement[A]): ToStatement[Some[A]] with NotNullGuard
Sets not empty optional A inferred as Some[A].
Sets not empty optional A inferred as Some[A].
SQL("SELECT * FROM Test WHERE category = {c}").on('c -> Some("cat"))
-
implicit
def
sortedSetToStatement[A](implicit c: ToStatement[A]): ToStatement[SortedSet[A]]
Sets multi-value parameter from sorted set on statement.
Sets multi-value parameter from sorted set on statement.
SQL("SELECT * FROM Test WHERE cat IN ({categories})"). on('categories -> SortedSet("a", "b", "c")
-
implicit
def
streamToStatement[A](implicit c: ToStatement[A]): ToStatement[Stream[A]]
Sets multi-value parameter from stream on statement.
Sets multi-value parameter from stream on statement.
SQL("SELECT * FROM Test WHERE cat IN ({categories})"). on('categories -> Stream(1, 3, 4)
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
implicit
def
timestampWrapper1ToStatement[T <: TimestampWrapper1]: ToStatement[T]
Sets a wrapped timestamp as statement parameter.
Sets a wrapped timestamp as statement parameter. For
null
value,setNull
withTIMESTAMP
is called on statement.val wrapper = new { // Any value with a `.getTimestamp` val getTimestamp = new java.sql.Timestamp(123L) } SQL("UPDATE tbl SET modified = {ts}").on('ts -> wrapper)
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
implicit
def
vectorToStatement[A](implicit c: ToStatement[A]): ToStatement[Vector[A]]
Sets multi-value parameter from vector on statement.
Sets multi-value parameter from vector on statement.
SQL("SELECT * FROM Test WHERE cat IN ({categories})"). on('categories -> Vector("a", "b", "c")
-
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
- @native() @throws( ... )
-
implicit
object
booleanToStatement extends ToStatement[Boolean]
Sets boolean value on statement.
Sets boolean value on statement.
SQL("SELECT * FROM Test WHERE enabled = {b}").on('b -> true)
-
implicit
object
byteToStatement extends ToStatement[Byte]
Sets byte value on statement.
Sets byte value on statement.
SQL("SELECT * FROM Test WHERE flag = {b}").on('b -> 1.toByte)
-
implicit
object
charToStatement extends ToStatement[Char]
Sets character as parameter value.
Sets character as parameter value.
SQL("SELECT * FROM tbl WHERE flag = {c}").on("c" -> 'f')
-
implicit
object
characterToStatement extends ToStatement[Character]
Sets Java Character as parameter value.
Sets Java Character as parameter value. For
null
character,setNull
withVARCHAR
is called on statement.SQL("SELECT * FROM tbl WHERE flag = {c}"). on("c" -> new java.lang.Character('f'))
-
implicit
object
dateToStatement extends ToStatement[Date]
Sets date as statement parameter.
Sets date as statement parameter. For
null
value,setNull
withTIMESTAMP
is called on statement.SQL("UPDATE tbl SET modified = {d}").on('d -> new Date())
-
implicit
object
doubleToStatement extends ToStatement[Double]
Sets double value on statement.
Sets double value on statement.
SQL("SELECT * FROM Test WHERE flag = {b}").on('b -> 1d)
-
implicit
object
floatToStatement extends ToStatement[Float]
Sets float value on statement.
Sets float value on statement.
SQL("SELECT * FROM Test WHERE flag = {b}").on('b -> 1f)
-
implicit
object
intToStatement extends ToStatement[Int]
Sets integer value on statement.
Sets integer value on statement.
SQL("SELECT * FROM Test WHERE flag = {b}").on('b -> 1)
-
implicit
object
integerToStatement extends ToStatement[Integer]
Sets Java Integer object on statement.
Sets Java Integer object on statement. For
null
value,setNull
withINTEGER
is called on statement.SQL("SELECT * FROM Test WHERE flag = {b}"). on('b -> new java.lang.Integer(1))
-
implicit
object
javaBigDecimalToStatement extends ToStatement[BigDecimal]
Sets Java big decimal on statement.
Sets Java big decimal on statement. Value
null
is accepted.SQL("UPDATE tbl SET max = {m}").on('m -> new java.math.BigDecimal(10.02f))
-
implicit
object
javaBigIntegerToStatement extends ToStatement[BigInteger]
Sets Java big integer on statement.
Sets Java big integer on statement. For
null
value,setNull
withNUMERIC
is called on statement.SQL("UPDATE tbl SET max = {m}").on('m -> new BigInteger(15))
-
implicit
object
javaBooleanToStatement extends ToStatement[Boolean]
Sets Java Boolean object on statement.
Sets Java Boolean object on statement. For
null
value,setNull
withBOOLEAN
is called on statement.SQL("SELECT * FROM Test WHERE enabled = {b}"). on('b -> java.lang.Boolean.TRUE)
-
implicit
object
javaByteToStatement extends ToStatement[Byte]
Sets Java Byte object on statement.
Sets Java Byte object on statement. For
null
value,setNull
withTINYINT
is called on statement.SQL("SELECT * FROM Test WHERE flag = {b}").on('b -> new java.lang.Byte(1))
-
implicit
object
javaDoubleToStatement extends ToStatement[Double]
Sets Java Double object on statement.
Sets Java Double object on statement. For
null
value,setNull
withDOUBLE
is called on statement.SQL("SELECT * FROM Test WHERE flag = {b}"). on('b -> new java.lang.Double(1d))
-
implicit
object
javaFloatToStatement extends ToStatement[Float]
Sets Java Float object on statement.
Sets Java Float object on statement. For
null
value,setNull
withFLOAT
is called on statement.SQL("SELECT * FROM Test WHERE flag = {b}"). on('b -> new java.lang.Float(1f))
-
implicit
object
javaLongToStatement extends ToStatement[Long]
Sets Java Long object on statement.
Sets Java Long object on statement. For
null
value,setNull
withBIGINT
is called on statement.SQL("SELECT * FROM Test WHERE flag = {b}"). on('b -> new java.lang.Long(1l))
-
implicit
object
javaShortToStatement extends ToStatement[Short]
Sets Java Short object on statement.
Sets Java Short object on statement. For
null
value,setNull
withSMALLINT
is called on statement.SQL("SELECT * FROM Test WHERE flag = {b}"). on('b -> new java.lang.Short(1.toShort))
-
implicit
object
longToStatement extends ToStatement[Long]
Sets long value on statement.
Sets long value on statement.
SQL("SELECT * FROM Test WHERE flag = {b}").on('b -> 1l)
-
implicit
object
objectToStatement extends ToStatement[Object]
Sets opaque value as statement parameter.
Sets opaque value as statement parameter. UNSAFE: It's set using
java.sql.PreparedStatement.setObject
.SQL("EXEC indexed_at {d}").on('d -> anorm.Object(new java.util.Date()))
-
implicit
object
scalaBigDecimalToStatement extends ToStatement[BigDecimal]
Sets big decimal on statement.
Sets big decimal on statement. For
null
value,setNull
withDECIMAL
is called on statement.SQL("UPDATE tbl SET max = {m}").on('m -> BigDecimal(10.02f))
-
implicit
object
scalaBigIntegerToStatement extends ToStatement[BigInt]
Sets big integer on statement.
Sets big integer on statement. For
null
value,setNull
withNUMERIC
is called on statement.SQL("UPDATE tbl SET max = {m}").on('m -> BigInt(15))
-
implicit
object
shortToStatement extends ToStatement[Short]
Sets short value on statement.
Sets short value on statement.
SQL("SELECT * FROM Test WHERE flag = {b}").on('b -> 1.toShort)
-
implicit
object
stringToStatement extends ToStatement[String]
Sets string as parameter value.
Sets string as parameter value. Value
null
is accepted.SQL("SELECT * FROM tbl WHERE name = {n}").on("n" -> "str")
-
implicit
object
timestampToStatement extends ToStatement[Timestamp]
Sets timestamp as statement parameter.
Sets timestamp as statement parameter. Value
null
is accepted.SQL("UPDATE tbl SET modified = {ts}"). on('ts -> new Timestamp(date.getTime))
-
implicit
object
uuidToStatement extends ToStatement[UUID]
Sets UUID as statement parameter.
Sets UUID as statement parameter. For
null
value,setNull
withVARCHAR
is called on statement.SQL("INSERT INTO lang_tbl(id, name) VALUE ({i}, {n})"). on("i" -> JUUID.randomUUID(), "n" -> "lang")
Deprecated Value Members
-
implicit
object
noneToStatement extends ToStatement[None.type]
Sets null for None value.
Sets null for None value.
SQL("SELECT * FROM Test WHERE category = {c}") .on('c -> None)
- Annotations
- @deprecated
- Deprecated
(Since version 2.3.7) Parameter value should be passed using
Option.empty[T]