Package io.jmix.reports.llm
Class LlmDataQuery
java.lang.Object
io.jmix.reports.llm.LlmDataQuery
A JPQL query generated from a natural-language prompt, together with everything needed to execute it
and to show it to a report designer.
An instance is stored in the data set (see DataSet.getLlmGeneratedQuery())
and reused by subsequent report runs, so it carries no parameter values.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLlmDataQuery(String jpql, @Nullable List<String> resultProperties, @Nullable List<LlmQueryParameter> parameters, @Nullable String explanation, @Nullable List<String> warnings) LlmDataQuery(String jpql, @Nullable List<String> resultProperties, @Nullable List<LlmQueryParameter> parameters, @Nullable String explanation, @Nullable List<String> warnings, @Nullable Integer maxResults, @Nullable Integer firstResult) -
Method Summary
Modifier and TypeMethodDescription@Nullable String@Nullable IntegerReturns how many rows the query skips, ornullfor none — the offset half of the same contract asgetMaxResults().getJpql()@Nullable IntegerReturns how many rows the query is meant to return, ornullfor all of them.Returns the select aliases in select-clause order.protected static @Nullable IntegerpositiveOrNull(@Nullable Integer count) Keeps a row count only if it is one.
-
Field Details
-
jpql
-
resultProperties
-
parameters
-
explanation
-
warnings
-
maxResults
-
firstResult
-
-
Constructor Details
-
LlmDataQuery
-
LlmDataQuery
-
-
Method Details
-
positiveOrNull
Keeps a row count only if it is one. A zero or a negative number says nothing about how many rows to return — whether it comes from a model, from a document edited by hand, or from an application's own implementation of the seam — and a query without a count is a query that returns everything. Reading such a value as a count would empty a band instead. -
getJpql
- Returns:
- the JPQL select query; every select expression is aliased via
AS
-
getResultProperties
Returns the select aliases in select-clause order. They are the keys of the produced band rows, so a report template refers to band fields by these names.- Returns:
- the select aliases in select-clause order
-
getParameters
- Returns:
- named parameters the query references, with their types but without values
-
getExplanation
- Returns:
- human-readable description of what the query does, or
nullif none was produced
-
getWarnings
- Returns:
- assumptions and approximations reported when the query was generated
-
getMaxResults
Returns how many rows the query is meant to return, ornullfor all of them. A prompt asking for "the top 5 customers" says so here rather than in the text: JPQL has nolimit, so the count is applied when the query is executed.- Returns:
- the row count the query is limited to, or
nullif it is not limited
-
getFirstResult
Returns how many rows the query skips, ornullfor none — the offset half of the same contract asgetMaxResults().- Returns:
- the number of rows to skip, or
nullif none are skipped
-