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 Stringprotected CurrentAuthenticationprotected static final Stringprotected static final Stringprotected static final Stringprotected Metadataprotected static final Stringprotected QuerySuggestionProviderprotected static final String -
Constructor Summary
ConstructorsConstructorDescriptionJpqlUiSuggestionProvider(CurrentAuthentication currentAuthentication, Metadata metadata, QuerySuggestionProvider querySuggestionProvider) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddCurrentUserAttributesSuggestions(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 SuggestionpropertyToSuggestionMapper(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-JOINclause used in the querywhere-WHEREclause used in the queryentityName- the name of the entity for which the query is createdisJoinClause- is suggestions requested forJOINclause- 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
-