@InterfaceStability.Experimental @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, statementParametersparams, populateParametersparameterized, parameterized, parameterized, parameterized, parameterized, parameterized, parameterized, parameterized, simple, simple, simple, simplepublic PreparedN1qlQuery(PreparedPayload plan, JsonArray positionalParams, N1qlParams params)
public PreparedN1qlQuery(PreparedPayload plan, JsonObject namedParams, N1qlParams params)
public PreparedN1qlQuery(PreparedPayload plan, N1qlParams params)
protected String statementType()
AbstractN1qlQueryThe type of the statement, used as JSON name in the final JSON form of the query
statementType in class ParameterizedN1qlQueryprotected Object statementValue()
AbstractN1qlQueryThe JSON representation for the underlying Statement in the final JSON form of the query
statementValue in class ParameterizedN1qlQuerypublic PreparedPayload statement()
N1qlQueryReturns the Statement from this query. Note that this is the only mandatory part of a N1QL query.
statement in class AbstractN1qlQuerypublic 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()
N1qlQueryConvert this query to a full N1QL query in Json form.
n1ql in class AbstractN1qlQueryCopyright © 2015 Couchbase, Inc.