Class JpqlUiSuggestionProvider

java.lang.Object
io.jmix.flowui.component.codeeditor.autocomplete.JpqlUiSuggestionProvider

@Component("flowui_JpqlUiSuggestionProvider") public class JpqlUiSuggestionProvider extends Object
Provides auto-completion suggestions for JPQL queries in the user interface. Used to provide auto-completion suggestions using Suggester in the CodeEditor component.
  • Field Details

  • Constructor Details

  • Method Details

    • getSuggestions

      public List<Suggestion> getSuggestions(Suggester.SuggestionContext context, @Nullable String join, @Nullable String where, String entityName, boolean isJoinClause)
      Parameters:
      context - the current state of the client-side of the component
      join - JOIN clause used in the query
      where - WHERE clause used in the query
      entityName - the name of the entity for which the query is created
      isJoinClause - is suggestions requested for JOIN clause
      Returns:
      list of suggestions for autocompletion of JPQL query based on the current editor state and the context of the call
    • getSuggestions

      public List<Suggestion> getSuggestions(Suggester.SuggestionContext context, String query, int queryPosition)
      Parameters:
      context - the current state of the client-side of the component
      query - the query for which the suggestions will be provided
      queryPosition - the position in the query for which suggestions will be provided
      Returns:
      list of suggestions for autocompletion of JPQL query
    • getSuggestions

      public List<Suggestion> getSuggestions(Suggester.SuggestionContext context, String query, int queryPosition, @Nullable Supplier<Map<String,String>> parametersSupplier)
      Parameters:
      context - the current state of the client-side of the component
      query - the query for which the suggestions will be provided
      queryPosition - the position in the query for which suggestions will be provided
      parametersSupplier - supplier of parameters for the query
      Returns:
      list of suggestions for autocompletion of JPQL query
    • addCurrentUserAttributesSuggestions

      protected void addCurrentUserAttributesSuggestions(Suggester.SuggestionContext context, List<Suggestion> suggestions)
    • getCurrentUserAttributes

      protected List<Suggestion> getCurrentUserAttributes()
    • propertyToSuggestionMapper

      protected Suggestion propertyToSuggestionMapper(MetaProperty metaProperty)
    • queryOptionToSuggestion

      protected Suggestion queryOptionToSuggestion(QuerySuggestions.Option option)