Class AnalyticsQuery

java.lang.Object
com.couchbase.client.java.analytics.AnalyticsQuery
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SimpleAnalyticsQuery

@Committed
@Public
public abstract class AnalyticsQuery
extends Object
implements Serializable
Base class for an analytics query.
Since:
2.4.3
Author:
Michael Nitschinger
See Also:
Serialized Form
  • Constructor Details

    • AnalyticsQuery

      public AnalyticsQuery()
  • Method Details

    • statement

      public abstract String statement()
      Returns the statement from this query.
    • params

      public abstract AnalyticsParams params()
      Returns the params from this query.
    • query

      public abstract JsonObject query()
      Returns the full query.
    • simple

      public static SimpleAnalyticsQuery simple​(String statement)
      Creates an AnalyticsQuery from just an analytics statement.
      Parameters:
      statement - the statement to send.
      Returns:
      a AnalyticsQuery.
    • simple

      public static SimpleAnalyticsQuery simple​(String statement, AnalyticsParams params)
      Creates an AnalyticsQuery from an analytics statement and custom parameters.
      Parameters:
      statement - the statement to send.
      params - the parameters to provide to the server in addition.
      Returns:
      a AnalyticsQuery.
    • parameterized

      public static ParameterizedAnalyticsQuery parameterized​(String statement, JsonArray positionalParams)
      Creates an AnalyticsQuery with positional parameters as part of the query.
      Parameters:
      statement - the statement to send.
      positionalParams - the positional parameters which will be put in for the placeholders.
      Returns:
      a AnalyticsQuery.
    • parameterized

      public static ParameterizedAnalyticsQuery parameterized​(String statement, JsonArray positionalParams, AnalyticsParams params)
      Creates an AnalyticsQuery with positional parameters as part of the query.
      Parameters:
      statement - the statement to send.
      positionalParams - the positional parameters which will be put in for the placeholders.
      params - the parameters to provide to the server in addition.
      Returns:
      a AnalyticsQuery.
    • parameterized

      public static ParameterizedAnalyticsQuery parameterized​(String statement, JsonObject namedParams)
      Creates an AnalyticsQuery with named parameters as part of the query.
      Parameters:
      statement - the statement to send.
      namedParams - the named parameters which will be put in for the placeholders.
      Returns:
      a AnalyticsQuery.
    • parameterized

      public static ParameterizedAnalyticsQuery parameterized​(String statement, JsonObject namedParams, AnalyticsParams params)
      Creates an AnalyticsQuery with named parameters as part of the query.
      Parameters:
      statement - the statement to send.
      namedParams - the named parameters which will be put in for the placeholders.
      params - the parameters to provide to the server in addition.
      Returns:
      a AnalyticsQuery.