final class DeferredQuery[T, RT <: ResultType] extends BaseQuery
Represents a query that produces results when executed.
- T
the type of the value(s) that will be returned.
- Source
- query.scala
- See also
- Alphabetic
- By Inheritance
- DeferredQuery
- BaseQuery
- AnyRef
- Any
- Hide All
- Show All
- 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
- val RT: RT
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- def collectAs[F[_], C](factory: Factory[T, C], tx: AsyncTransaction[F]): F[RT.AsyncR[C]]
Executes the query and returns all results as a collection of values.
Executes the query and returns all results as a collection of values.
- F
async type.
- C
collection type.
- factory
a Scala factory of the collection that will be collected.
- tx
neotypes transaction.
- returns
An asyncual value that will compute a collection of T elements.
val result: F[List[Person]] = driver.transact { tx => "MATCH (p: Person) RETURN p" .query(ResultMapper[Person]) .collectAs(List, tx) }
Example: - def collectAs[F[_], C](factory: Factory[T, C], driver: AsyncDriver[F], config: TransactionConfig = TransactionConfig.default): F[RT.AsyncR[C]]
Executes the query and returns all results as a collection of values.
Executes the query and returns all results as a collection of values.
- F
async type.
- C
collection type.
- factory
a Scala factory of the collection that will be collected.
- driver
neotypes driver.
- config
neotypes transaction config.
- returns
An asyncual value that will compute a collection of T elements.
val result: F[List[Person]] = "MATCH (p: Person) RETURN p" .query(ResultMapper[Person]) .collectAs(List, driver)
Example: - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def list[F[_]](tx: AsyncTransaction[F]): F[RT.AsyncR[List[T]]]
Executes the query and returns a scala.List of values.
Executes the query and returns a scala.List of values.
- F
async type.
- tx
neotypes transaction.
- returns
An asyncual value that will compute a List of T elements.
val result: F[List[Person]] = driver.transact { tx => "MATCH (p: Person) RETURN p" .query(ResultMapper[Person]) .list(tx) }
Example: - def list[F[_]](driver: AsyncDriver[F], config: TransactionConfig = TransactionConfig.default): F[RT.AsyncR[List[T]]]
Executes the query and returns a scala.List of values.
Executes the query and returns a scala.List of values.
- F
async type.
- driver
neotypes driver.
- config
neotypes transaction config.
- returns
An asyncual value that will compute a List of T elements.
val result: F[List[Person]] = "MATCH (p: Person) RETURN p" .query(ResultMapper[Person]) .list(driver)
Example: - def map[F[_], K, V](tx: AsyncTransaction[F])(implicit ev: <:<[T, (K, V)]): F[RT.AsyncR[Map[K, V]]]
Executes the query and returns a scala.Predef.Map of values.
Executes the query and returns a scala.Predef.Map of values.
- F
async type.
- K
keys type.
- V
values type.
- tx
neotypes transaction.
- ev
evidence that T is a tuple (K, V).
- returns
An asyncual value that will compute a Map of key-value elements.
val result: F[Map[String, Person]] = driver.transact { tx => "MATCH (p: Person) RETURN elementId(p), p" .query(ResultMapper[(String, Person)]) .map(tx) }
Example: - def map[F[_], K, V](driver: AsyncDriver[F], config: TransactionConfig = TransactionConfig.default)(implicit ev: <:<[T, (K, V)]): F[RT.AsyncR[Map[K, V]]]
Executes the query and returns a scala.Predef.Map of values.
Executes the query and returns a scala.Predef.Map of values.
- F
async type.
- K
keys type.
- V
values type.
- driver
neotypes driver.
- config
neotypes transaction config.
- ev
evidence that T is a tuple (K, V).
- returns
An asyncual value that will compute a Map of key-value elements.
val result: F[Map[String, Person]] = "MATCH (p: Person) RETURN elementId(p), p" .query(ResultMapper[(String, Person)]) .map(driver)
Example: - final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- val params: Map[String, QueryParam]
The parameters that will be substituted into the query statement.
The parameters that will be substituted into the query statement.
- Definition Classes
- DeferredQuery → BaseQuery
- val query: String
The query statement that will be executed.
The query statement that will be executed.
- Definition Classes
- DeferredQuery → BaseQuery
- def set[F[_]](tx: AsyncTransaction[F]): F[RT.AsyncR[Set[T]]]
Executes the query and returns a scala.Predef.Set of values.
Executes the query and returns a scala.Predef.Set of values.
- F
async type.
- tx
neotypes transaction.
- returns
An asyncual value that will compute a Set of T elements.
val result: F[Set[Person]] = driver.transact { tx => "MATCH (p: Person) RETURN p" .query(ResultMapper[Person]) .set(tx) }
Example: - def set[F[_]](driver: AsyncDriver[F], config: TransactionConfig = TransactionConfig.default): F[RT.AsyncR[Set[T]]]
Executes the query and returns a scala.Predef.Set of values.
Executes the query and returns a scala.Predef.Set of values.
- F
async type.
- driver
neotypes driver.
- config
neotypes transaction config.
- returns
An asyncual value that will compute a Set of T elements.
val result: F[Set[Person]] = "MATCH (p: Person) RETURN p" .query(ResultMapper[Person]) .set(driver)
Example: - def single[F[_]](tx: AsyncTransaction[F]): F[RT.AsyncR[T]]
Executes the query and returns the unique / first value.
Executes the query and returns the unique / first value.
- F
async type.
- tx
neotypes transaction.
- returns
An asyncual value that will compute a single T element.
val result: F[(Person, Movie)] = driver.transact { tx => "MATCH (p: Person {name: 'Charlize Theron'})-[]->(m: Movie) RETURN p, m" .query(ResultMapper[(Person, Movie)]) .single(tx) }
- Note
May fail if the query doesn't return exactly one record.
Example: - def single[F[_]](driver: AsyncDriver[F], config: TransactionConfig = TransactionConfig.default): F[RT.AsyncR[T]]
Executes the query and returns the unique / first value.
Executes the query and returns the unique / first value.
- F
async type.
- driver
neotypes driver.
- config
neotypes transaction config.
- returns
An asyncual value that will compute a single T element.
val result: F[(Person, Movie)] = "MATCH (p: Person {name: 'Charlize Theron'})-[]->(m: Movie) RETURN p, m" .query(ResultMapper[(Person, Movie)]) .single(driver)
- Note
May fail if the query doesn't return exactly one record.
Example: - def stream[S[_], F[_]](tx: StreamTransaction[S, F], chunkSize: Int): S[RT.StreamR[T]]
Executes the query and returns a Stream of values.
Executes the query and returns a Stream of values.
- S
stream type.
- F
async type.
- tx
neotypes transaction.
- chunkSize
number of elements to pull each time from the database; by default 256.
- returns
An stream of T elements.
val result: S[F, Person] = streamDriver.streamTransact { tx => "MATCH (p: Person) RETURN p" .query(ResultMapper[Person]) .stream(tx) }
- See also
Example: - def stream[S[_], F[_]](tx: StreamTransaction[S, F]): S[RT.StreamR[T]]
Executes the query and returns a Stream of values.
Executes the query and returns a Stream of values.
- S
stream type.
- F
async type.
- tx
neotypes transaction.
- returns
An stream of T elements.
val result: S[F, Person] = streamDriver.streamTransact { tx => "MATCH (p: Person) RETURN p" .query(ResultMapper[Person]) .stream(tx) }
- See also
Example: - def stream[S[_], F[_]](driver: StreamDriver[S, F], config: TransactionConfig = TransactionConfig.default, chunkSize: Int = 256): S[RT.StreamR[T]]
Executes the query and returns a Stream of values.
Executes the query and returns a Stream of values.
- S
stream type.
- F
async type.
- driver
neotypes driver.
- config
neotypes transaction config.
- chunkSize
number of elements to pull each time from the database; by default 256.
- returns
An stream of T elements.
val result: S[F, Person] = "MATCH (p: Person) RETURN p" .query(ResultMapper[Person]) .stream(streamDriver)
- See also
Example: - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def toString(): String
- Definition Classes
- BaseQuery → AnyRef → Any
- def vector[F[_]](tx: AsyncTransaction[F]): F[RT.AsyncR[Vector[T]]]
Executes the query and returns a scala.Vector of values.
Executes the query and returns a scala.Vector of values.
- F
async type.
- tx
neotypes transaction.
- returns
An asyncual value that will compute a Vector of T elements.
val result: F[Vector[Person]] = driver.transact { tx => "MATCH (p: Person) RETURN p" .query(ResultMapper[Person]) .vector(tx) }
Example: - def vector[F[_]](driver: AsyncDriver[F], config: TransactionConfig = TransactionConfig.default): F[RT.AsyncR[Vector[T]]]
Executes the query and returns a scala.Vector of values.
Executes the query and returns a scala.Vector of values.
- F
async type.
- driver
neotypes driver.
- config
neotypes transaction config.
- returns
An asyncual value that will compute a Vector of T elements.
val result: F[Vector[Person]] = "MATCH (p: Person) RETURN p" .query(ResultMapper[Person]) .vector(driver)
Example: - 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()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def withParams(params: Map[String, QueryParam]): DeferredQuery[T, RT]
Creates a new query with an updated set of parameters.
Creates a new query with an updated set of parameters.
- params
QueryParams to be added.
- returns
a new query with params added to existing params.
- Definition Classes
- DeferredQuery → BaseQuery
- Note
If params contains a key that is already present in the current query, the new value one will override the previous one.
- def withResultSummary(implicit ev: <:<[RT, Simple.type]): DeferredQuery[T, WithResultSummary.type]
Transforms this simple query, into one that preserves the org.neo4j.driver.summary.ResultSummary of its executions.