@InterfaceStability.Uncommitted @InterfaceAudience.Private public class PreparedN1qlQuery extends ParameterizedN1qlQuery
Represent a N1QL query, with a parameterized prepared statement plan (for which the values must be passed according to the type and number of placeholders).
Positional placeholders (in the form of either “$1” “$2” or just simple “?”) are filled by the values taken from a JsonArray
.
Named placeholders (in the form of “$param1”, “$myOtherParam”, etc…) are filled by the values taken from a JsonObject
. If in this JsonObject attributes don’t have the $ prefix, it is added upon building the query.
Constructor and Description |
---|
PreparedN1qlQuery(PreparedPayload plan,
JsonArray positionalParams,
N1qlParams params) |
PreparedN1qlQuery(PreparedPayload plan,
JsonObject namedParams,
N1qlParams params) |
PreparedN1qlQuery(PreparedPayload plan,
N1qlParams params) |
Modifier and Type | Method and Description |
---|---|
boolean |
isEncodedPlanEnabled()
Returns whether or not the encodedPlan part of the payload will be made part of the N1QL statement.
|
JsonObject |
n1ql()
Convert this query to a full N1QL query in Json form.
|
void |
setEncodedPlanEnabled(boolean enabled)
Toggle whether or not the encodedPlan part of the payload should be made part of the N1QL statement.
|
PreparedPayload |
statement()
Returns the
Statement from this query. |
protected String |
statementType()
The type of the statement, used as JSON name in the final JSON form of the query
|
protected Object |
statementValue()
The JSON representation for the underlying
Statement in the final JSON form of the query |
isPositional, statementParameters, toString
params, populateParameters
parameterized, parameterized, parameterized, parameterized, parameterized, parameterized, parameterized, parameterized, simple, simple, simple, simple
public PreparedN1qlQuery(PreparedPayload plan, JsonArray positionalParams, N1qlParams params)
public PreparedN1qlQuery(PreparedPayload plan, JsonObject namedParams, N1qlParams params)
public PreparedN1qlQuery(PreparedPayload plan, N1qlParams params)
protected String statementType()
AbstractN1qlQuery
The type of the statement, used as JSON name in the final JSON form of the query
statementType
in class ParameterizedN1qlQuery
protected Object statementValue()
AbstractN1qlQuery
The JSON representation for the underlying Statement
in the final JSON form of the query
statementValue
in class ParameterizedN1qlQuery
public PreparedPayload statement()
N1qlQuery
Returns the Statement
from this query. Note that this is the only mandatory part of a N1QL query.
statement
in class AbstractN1qlQuery
public void setEncodedPlanEnabled(boolean enabled)
Toggle whether or not the encodedPlan part of the payload should be made part of the N1QL statement.
enabled
- true to activate encodedPlan in the N1QL statement, false to avoid including it.public boolean isEncodedPlanEnabled()
Returns whether or not the encodedPlan part of the payload will be made part of the N1QL statement.
public JsonObject n1ql()
N1qlQuery
Convert this query to a full N1QL query in Json form.
n1ql
in class AbstractN1qlQuery
Copyright © 2015 Couchbase, Inc.