public abstract class AbstractN1qlQuery extends N1qlQuery
An abstract base for N1QL N1qlQuery
.
Modifier | Constructor and Description |
---|---|
protected |
AbstractN1qlQuery(Statement statement,
N1qlParams params) |
Modifier and Type | Method and Description |
---|---|
JsonObject |
n1ql()
Convert this query to a full N1QL query in Json form.
|
N1qlParams |
params()
Returns the
N1qlParams representing customization of the N1QL query. |
static void |
populateParameters(JsonObject query,
JsonValue params)
Populate a
JsonObject representation of a query with parameters, either positional or named. |
Statement |
statement()
Returns the
Statement from this query. |
protected abstract JsonValue |
statementParameters()
The parameters to inject in the query, null or empty to ignore.
|
protected abstract String |
statementType()
The type of the statement, used as JSON name in the final JSON form of the query
|
protected abstract Object |
statementValue()
The JSON representation for the underlying
Statement in the final JSON form of the query |
parameterized, parameterized, parameterized, parameterized, parameterized, parameterized, parameterized, parameterized, simple, simple, simple, simple
protected AbstractN1qlQuery(Statement statement, N1qlParams params)
protected abstract String statementType()
The type of the statement, used as JSON name in the final JSON form of the query
protected abstract Object statementValue()
The JSON representation for the underlying Statement
in the final JSON form of the query
protected abstract JsonValue statementParameters()
The parameters to inject in the query, null or empty to ignore.
public N1qlParams params()
N1qlQuery
Returns the N1qlParams
representing customization of the N1QL query.
Note that this is different from named or positional parameters (which relate to the statement).
params
in class N1qlQuery
N1qlParams
for this query, null if none.public Statement statement()
N1qlQuery
Returns the Statement
from this query. Note that this is the only mandatory part of a N1QL query.
public JsonObject n1ql()
N1qlQuery
Convert this query to a full N1QL query in Json form.
public static void populateParameters(JsonObject query, JsonValue params)
Populate a JsonObject
representation of a query with parameters, either positional or named.
JsonObject
, named parameters will be used (prefixing the names with ‘$’ if not present).JsonArray
, positional parameters will be used.Note that the JsonValue
should not be mutated until n1ql()
is called since it backs the creation of the query string.
Also, the Statement
is expected to contain the correct placeholders (corresponding names and number).
query
- the query JsonObject to populated with parameters.params
- the parameters.Copyright © 2014 Couchbase, Inc.