Class AbstractSqlLikeQueryBuilder.QueryState

java.lang.Object
io.micronaut.data.model.query.builder.AbstractSqlLikeQueryBuilder.QueryState
Enclosing class:
AbstractSqlLikeQueryBuilder

@Internal protected final class AbstractSqlLikeQueryBuilder.QueryState extends Object
The state of the query.
  • Constructor Details

    • QueryState

      public QueryState(QueryModel query, boolean allowJoins, boolean useAlias)
  • Method Details

    • getRootAlias

      @Nullable public @Nullable String getRootAlias()
      Returns:
      The root alias
    • getEntity

      public PersistentEntity getEntity()
      Returns:
      The entity
    • addAdditionalRequiredParameter

      public String addAdditionalRequiredParameter(@NonNull @NonNull String name)
      Add a required parameter.
      Parameters:
      name - The name
      Returns:
      name A placeholder in a query
    • getFinalQuery

      public String getFinalQuery()
    • getQueryParts

      public List<String> getQueryParts()
    • getQuery

      public StringBuilder getQuery()
      Returns:
      The query string
    • isAllowJoins

      public boolean isAllowJoins()
      Returns:
      Does the query allow joins
    • getQueryModel

      public QueryModel getQueryModel()
      Returns:
      The query model object
    • applyJoin

      public String applyJoin(@NonNull @NonNull JoinPath jp)
      Applies a join for the given association.
      Parameters:
      jp - The join path
      Returns:
      The alias
    • computeAlias

      @NonNull public @NonNull String computeAlias(String associationPath)
      Computes the alias for the given association path given the current state of the joins.
      Parameters:
      associationPath - The association path.
      Returns:
      The alias
    • isJoined

      public boolean isJoined(String associationPath)
      Checks if the path is joined already.
      Parameters:
      associationPath - The association path.
      Returns:
      true if joined
    • shouldEscape

      public boolean shouldEscape()
      Returns:
      Should escape the query
    • getAdditionalRequiredParameters

      @NonNull public @NonNull Map<String,String> getAdditionalRequiredParameters()
      The additional required parameters.
      Returns:
      The parameters
    • getParameterBindings

      public List<QueryParameterBinding> getParameterBindings()
      The parameter binding.
      Returns:
      The parameter binding
    • pushParameter

      public void pushParameter(@NonNull @NonNull BindingParameter bindingParameter, @NonNull BindingParameter.BindingContext bindingContext)
    • pushParameter

      public void pushParameter(@NonNull @NonNull QueryParameterBinding parameterBinding)
      Adds query parameter binding.
      Parameters:
      parameterBinding - the query parameter binding
    • getJoinPaths

      public List<JoinPath> getJoinPaths()
    • setJoinPaths

      public void setJoinPaths(List<JoinPath> joinPaths)