Class EntityDataLoadResult

java.lang.Object
io.jmix.aitools.dataload.EntityDataLoadResult

public class EntityDataLoadResult extends Object
Outcome of AiDataLoadService.loadData(String): the original user request together with the LLM-generated query, its validation result and the fetched rows.

Always returned - inspect isExecuted() and getExecutionError() to tell a successful load from a generation/validation/execution failure.

  • Field Details

  • Constructor Details

  • Method Details

    • getQuery

      public EntityDataLoadQuery getQuery()
      Returns the query as generated by the LLM, before any validation repair: JPQL, parameters, result-property names, explanation and warnings. If the query was repaired during execution, the executed query may differ — only this original version is exposed here.
      Returns:
      the LLM-generated query, before any repair
    • getUserText

      public String getUserText()
      Returns the original natural-language request the query was generated from.
      Returns:
      the original natural-language request
    • getValidationResult

      public JpqlValidationResult getValidationResult()
      Returns the validation outcome for getQuery(): parse/semantic issues found before execution. When JpqlValidationResult.isValid() is false the query is not executed.
      Returns:
      the validation outcome
    • isHasMore

      public boolean isHasMore()
      Returns whether more rows are available in the database beyond the returned page. The caller can re-issue the request with an increased firstResult.
      Returns:
      true if more rows are available, false otherwise
    • getRows

      public List<Map<String,Object>> getRows()
      Returns the fetched rows; each map is keyed by the names from EntityDataLoadQuery.getResultProperties(). Empty when the query was not executed or produced no rows.
      Returns:
      the fetched rows
    • isExecuted

      public boolean isExecuted()
      Returns whether the query was actually executed against the database. false means generation failed, validation rejected the query, or execution threw — see getExecutionError().
      Returns:
      true if the query was executed, false otherwise
    • getExecutionError

      public @Nullable String getExecutionError()
      Returns the execution error message, or null if the query was executed successfully or never attempted.
      Returns:
      the execution error message, or null