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 query that was executed (or failed validation), 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 that was executed, or the one that failed validation and was not executed. It is the LLM-generated query or, if that failed validation, its repair. A repaired query keeps the generated result-property names, so the rows stay keyed by them. The row-level conditions added for the current user at execution are not included.
      Returns:
      the executed query, or the one that failed validation
    • 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 in it 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,@Nullable Object>> getRows()
      Returns the fetched rows; each map is keyed by the names from getQuery().getResultProperties(). Empty when the query was not executed or produced no rows. A value is null when the query returned no value for that column; an empty string is a value the query actually returned.
      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