Class PreparedN1qlQuery

  • All Implemented Interfaces:
    Serializable

    @Uncommitted
    @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.
    Since:
    2.1
    Author:
    Simon Baslé
    See Also:
    Serialized Form
    • Method Detail

      • statement

        public PreparedPayload statement()
        Description copied from class: N1qlQuery
        Returns the Statement from this query. Note that this is the only mandatory part of a N1QL query.
        Overrides:
        statement in class AbstractN1qlQuery
        Returns:
        the statement that forms the base of this query
      • setEncodedPlanEnabled

        public void setEncodedPlanEnabled​(boolean enabled)
        Toggle whether or not the encodedPlan part of the payload should be made part of the N1QL statement.
        Parameters:
        enabled - true to activate encodedPlan in the N1QL statement, false to avoid including it.
      • isEncodedPlanEnabled

        public boolean isEncodedPlanEnabled()
        Returns whether or not the encodedPlan part of the payload will be made part of the N1QL statement.
        Returns:
        true if encodedPlan is to be used in statement, false otherwise.
      • n1ql

        public JsonObject n1ql()
        Description copied from class: N1qlQuery
        Convert this query to a full N1QL query in Json form.
        Overrides:
        n1ql in class AbstractN1qlQuery
        Returns:
        the json representation of this query (including all relevant parameters)