Class JpqlUiSuggestionProvider
java.lang.Object
io.jmix.flowui.component.codeeditor.autocomplete.JpqlUiSuggestionProvider
Provides auto-completion suggestions for JPQL queries in the user interface.
Used to provide auto-completion suggestions using
Suggester
in the CodeEditor
component.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
protected CurrentAuthentication
protected static final String
protected static final String
protected static final String
protected Metadata
protected static final String
protected QuerySuggestionProvider
protected static final String
-
Constructor Summary
ConstructorsConstructorDescriptionJpqlUiSuggestionProvider
(CurrentAuthentication currentAuthentication, Metadata metadata, QuerySuggestionProvider querySuggestionProvider) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addCurrentUserAttributesSuggestions
(Suggester.SuggestionContext context, List<Suggestion> suggestions) protected List<Suggestion>
getSuggestions
(Suggester.SuggestionContext context, String query, int queryPosition) getSuggestions
(Suggester.SuggestionContext context, String query, int queryPosition, Supplier<Map<String, String>> parametersSupplier) getSuggestions
(Suggester.SuggestionContext context, String join, String where, String entityName, boolean isJoinClause) protected Suggestion
propertyToSuggestionMapper
(MetaProperty metaProperty) protected Suggestion
-
Field Details
-
INITIAL_QUERY
- See Also:
-
JOIN
- See Also:
-
WHERE
- See Also:
-
ENTITY_PLACEHOLDER
- See Also:
-
QUERY_LANGUAGE
- See Also:
-
CURRENT_USER_PREFIX
- See Also:
-
currentAuthentication
-
metadata
-
querySuggestionProvider
-
-
Constructor Details
-
JpqlUiSuggestionProvider
public JpqlUiSuggestionProvider(CurrentAuthentication currentAuthentication, Metadata metadata, QuerySuggestionProvider querySuggestionProvider)
-
-
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 componentjoin
-JOIN
clause used in the querywhere
-WHERE
clause used in the queryentityName
- the name of the entity for which the query is createdisJoinClause
- is suggestions requested forJOIN
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 componentquery
- the query for which the suggestions will be providedqueryPosition
- 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 componentquery
- the query for which the suggestions will be providedqueryPosition
- the position in the query for which suggestions will be providedparametersSupplier
- 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
-
propertyToSuggestionMapper
-
queryOptionToSuggestion
-