java.lang.Object
org.mule.runtime.extension.api.dsql.DsqlQuery
org.mule.runtime.extension.internal.dsql.DefaultDsqlQuery

public final class DefaultDsqlQuery extends DsqlQuery
Represents a parsed DSQL query.
Since:
1.0
  • Constructor Details

    • DefaultDsqlQuery

      public DefaultDsqlQuery(EntityType type, List<Field> fields, List<Field> orderByFields, Direction direction, Expression filterExpression, Integer limit, Integer offset)
      Creates a new instance.
      Parameters:
      type - the entity type to be queried
      fields - the selected fields of the entity.
      orderByFields - the fields to order the query
      direction - ascending or descending sort order.
      filterExpression - an expression to filter the result set items.
      limit - the maximum number of items to be returned.
      offset - the number of items to skip from the beginning of the result set.
  • Method Details

    • getFields

      public List<Field> getFields()
      Specified by:
      getFields in class DsqlQuery
      Returns:
      the selected fields from the queried entity.
    • getOrderByFields

      public List<Field> getOrderByFields()
      Specified by:
      getOrderByFields in class DsqlQuery
      Returns:
      the fields used to sort the result set.
    • getDirection

      public Direction getDirection()
      Specified by:
      getDirection in class DsqlQuery
      Returns:
      the sorting direction.
    • getFilterExpression

      public Expression getFilterExpression()
      Specified by:
      getFilterExpression in class DsqlQuery
      Returns:
      an Expression to filter the queried result set.
    • getType

      public EntityType getType()
      Specified by:
      getType in class DsqlQuery
      Returns:
      the entity that is being queried.
    • getLimit

      public int getLimit()
      Specified by:
      getLimit in class DsqlQuery
      Returns:
      the maximum number of item returned in the result set.
    • getOffset

      public int getOffset()
      Specified by:
      getOffset in class DsqlQuery
      Returns:
      the number of items to skip from the beginning of the result set.
    • translate

      public String translate(QueryTranslator queryTranslator)
      Translates this DsqlQuery to a query in another query language using the specified queryTranslator.
      Specified by:
      translate in class DsqlQuery
      Parameters:
      queryTranslator - a QueryTranslator instance used to translate from DSQL to another query language.
      Returns:
      a String that represents a translated query using the queryTranslator.