sealed trait PGJson extends AnyRef
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- PGJson
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
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
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asJson[T](value: T)(implicit w: Writes[T]): ParameterValue
- value
the value to be passed as a JSON parameter
- w
the Play writes to be used to serialized the value as JSON
import play.api.libs.json._ import anorm._, postgresql._ case class Foo(bar: String) implicit val w: Writes[Foo] = Json.writes[Foo] val value = Foo("lorem") def foo(implicit con: java.sql.Connection) = SQL"INSERT INTO test(id, json) VALUES(${"bar"}, ${asJson(value)})". executeUpdate()
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def fromJson[T](implicit r: Reads[T]): Column[T]
- r
the Play reader to be used from the selected JSONB value
import play.api.libs.json.Reads import anorm._, postgresql._ case class Foo(bar: String) def foo(implicit con: java.sql.Connection, r: Reads[Foo]): Foo = SQL"SELECT json FROM test". as(SqlParser.scalar(fromJson[Foo]).single)
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- implicit val jsObjectColumn: Column[JsObject]
import play.api.libs.json.JsObject import anorm._, postgresql._ def foo(implicit con: java.sql.Connection) = SQL"SELECT json FROM test".as(SqlParser.scalar[JsObject].single)
- implicit val jsValueColumn: Column[JsValue]
import play.api.libs.json.JsValue import anorm._, postgresql._ def foo(implicit con: java.sql.Connection) = SQL"SELECT json FROM test".as(SqlParser.scalar[JsValue].single)
- implicit def jsValueToStatement[J <: JsValue]: ToStatement[J]
Allows to pass a
JsValue
as parameter to be stored asPGobject
. - 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()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- implicit object JsObjectParameterMetaData extends ParameterMetaData[JsObject]
- implicit object JsValueParameterMetaData extends ParameterMetaData[JsValue]