Package io.jmix.reports.llm
Class LlmQueryParameter
java.lang.Object
io.jmix.reports.llm.LlmQueryParameter
A named parameter of an
LlmDataQuery: the name used in the JPQL text and the Java type of the value it
stands for. A parameter declares itself; it does not carry a value. The value a run binds comes from the run
— the report parameters, the rows of the parent bands, the cross-tab axes — which is what lets one stored
query serve every run of the report.
The type is what a model is told the value will be, and what the stored query keeps saying about it; a run binds the value it holds as it is, without consulting the declared type. The same class describes a parameter offered to query generation and one declared by a stored query.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected booleanTransient on purpose: it describes what the run offers, not what the stored query declares, and must not become part of the stored document.protected Stringprotected booleanTransient for the same reason asmultiValued: whether a run may leave this parameter empty is a fact about the report, not about the query text that references it. -
Constructor Summary
ConstructorsConstructorDescriptionLlmQueryParameter(String name, String javaType) LlmQueryParameter(String name, String javaType, boolean multiValued) LlmQueryParameter(String name, String javaType, boolean multiValued, boolean optional) -
Method Summary
Modifier and TypeMethodDescriptiongetName()booleanTells a parameter that carries several values ofgetJavaType()from an ordinary single-valued one, so that a query can match it withIN.booleanTells a parameter a run may leave empty from one it always supplies — an optional report parameter, as opposed to a required one.toString()
-
Field Details
-
name
-
javaType
-
multiValued
protected transient boolean multiValuedTransient on purpose: it describes what the run offers, not what the stored query declares, and must not become part of the stored document. -
optional
protected transient boolean optionalTransient for the same reason asmultiValued: whether a run may leave this parameter empty is a fact about the report, not about the query text that references it.
-
-
Constructor Details
-
LlmQueryParameter
-
LlmQueryParameter
-
LlmQueryParameter
-
-
Method Details
-
getName
- Returns:
- parameter name as used in the JPQL text, without the leading colon
-
getJavaType
- Returns:
- fully qualified Java type name the value is bound as, for example
java.time.LocalDate
-
isMultiValued
public boolean isMultiValued()Tells a parameter that carries several values ofgetJavaType()from an ordinary single-valued one, so that a query can match it withIN. This may be a collection-valued report parameter or the values of one cross-tab axis. Stated by whoever offers the parameter, since a parameter carries no value to infer it from.- Returns:
trueif the value is a collection ofgetJavaType()
-
isOptional
public boolean isOptional()Tells a parameter a run may leave empty from one it always supplies — an optional report parameter, as opposed to a required one. A query referencing an optional parameter has to survive an empty value, which in JPQL means guarding the condition with(:name is null or …); generation is told so, and a run bindsnullfor such a parameter instead of failing.- Returns:
trueif a run may bindnullfor this parameter
-
toString
-