Class JpqlExecutionResult
java.lang.Object
io.jmix.aitools.dataload.execution.JpqlExecutionResult
Outcome of a single
JpqlExecutionService.execute(io.jmix.aitools.dataload.execution.JpqlExecutionRequest) call.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected @Nullable Stringprotected @Nullable Integerprotected GeneratedJpqlResultprotected booleanprotected @Nullable Integerprotected booleanprotected JpqlValidationResult -
Constructor Summary
ConstructorsConstructorDescriptionJpqlExecutionResult(GeneratedJpqlResult generatedJpqlResult, JpqlValidationResult validationResult, List<Map<String, Object>> rows, @Nullable Integer maxResults, @Nullable Integer firstResult, boolean hasMore, boolean repaired, boolean executed, @Nullable String executionError) -
Method Summary
Modifier and TypeMethodDescriptionstatic JpqlExecutionResultfailed(GeneratedJpqlResult generatedJpqlResult, JpqlValidationResult validationResult, boolean repaired) Creates a non-executed result for a query that failed validation.static JpqlExecutionResultfailed(GeneratedJpqlResult generatedJpqlResult, JpqlValidationResult validationResult, int maxResults, boolean repaired, @Nullable String executionError) Creates a non-executed result for a query that passed validation but failed at execution time.@Nullable StringReturns the error message from a failed execution.@Nullable IntegerReturns the row offset that was applied.Returns the generated (and possibly repaired) JPQL draft that was processed.@Nullable IntegerReturns the effective maximum number of rows that was applied.getRows()Returns the fetched rows as an unmodifiable list, each row being a property-name-to-value map.Returns the validation result of the processed query.booleanReturns whether the query was actually executed against the data store.booleanReturns whether more rows are available beyondgetMaxResults().booleanReturns whether the query was repaired before execution.
-
Field Details
-
generatedJpqlResult
-
validationResult
-
rows
-
hasMore
protected boolean hasMore -
repaired
protected boolean repaired -
executed
protected boolean executed -
executionError
-
maxResults
-
firstResult
-
-
Constructor Details
-
JpqlExecutionResult
public JpqlExecutionResult(GeneratedJpqlResult generatedJpqlResult, JpqlValidationResult validationResult, List<Map<String, Object>> rows, @Nullable Integer maxResults, @Nullable Integer firstResult, boolean hasMore, boolean repaired, boolean executed, @Nullable String executionError) - Parameters:
generatedJpqlResult- generated (and possibly repaired) query draftvalidationResult- validation result of the processed queryrows- fetched rows, each a property-name-to-value mapmaxResults- effective maximum number of rowsfirstResult- applied row offsethasMore- whether more rows are available beyondmaxResultsrepaired- whether the query was repaired before executionexecuted- whether the query was actually executedexecutionError- error message from a failed execution
-
-
Method Details
-
failed
public static JpqlExecutionResult failed(GeneratedJpqlResult generatedJpqlResult, JpqlValidationResult validationResult, boolean repaired) Creates a non-executed result for a query that failed validation.- Parameters:
generatedJpqlResult- generated (and possibly repaired) query draftvalidationResult- validation result of the processed queryrepaired- whether a repair attempt was made before validation failed- Returns:
- non-executed result describing the validation failure
-
failed
public static JpqlExecutionResult failed(GeneratedJpqlResult generatedJpqlResult, JpqlValidationResult validationResult, int maxResults, boolean repaired, @Nullable String executionError) Creates a non-executed result for a query that passed validation but failed at execution time.- Parameters:
generatedJpqlResult- generated (and possibly repaired) query draftvalidationResult- validation result of the processed querymaxResults- effective maximum number of rows that was appliedrepaired- whether the query was repaired before executionexecutionError- error message from the failed execution, ornullif unavailable- Returns:
- non-executed result describing the execution failure
-
getGeneratedJpqlResult
Returns the generated (and possibly repaired) JPQL draft that was processed.- Returns:
- generated query draft
-
getValidationResult
Returns the validation result of the processed query.- Returns:
- validation result
-
getRows
Returns the fetched rows as an unmodifiable list, each row being a property-name-to-value map. Empty if the query was not executed or returned nothing.- Returns:
- fetched rows, never
null
-
getMaxResults
Returns the effective maximum number of rows that was applied.- Returns:
- maximum number of rows, or
nullif unknown
-
getFirstResult
Returns the row offset that was applied.- Returns:
- row offset, or
nullif no offset was used
-
isHasMore
public boolean isHasMore()Returns whether more rows are available beyondgetMaxResults().- Returns:
trueif more rows are available
-
isRepaired
public boolean isRepaired()Returns whether the query was repaired before execution.- Returns:
trueif the query was repaired
-
isExecuted
public boolean isExecuted()Returns whether the query was actually executed against the data store.- Returns:
trueif the query was executed
-
getExecutionError
Returns the error message from a failed execution.- Returns:
- execution error message, or
nullif execution succeeded or was never attempted
-