Package io.quarkus.hibernate.orm.dev.ui
Class HibernateOrmDevJsonRpcService
java.lang.Object
io.quarkus.hibernate.orm.dev.ui.HibernateOrmDevJsonRpcService
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record(package private) static final record(package private) static final record -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
assistant
@Inject jakarta.enterprise.inject.Instance<Optional<io.quarkus.assistant.runtime.dev.Assistant>> assistant
-
-
Constructor Details
-
HibernateOrmDevJsonRpcService
public HibernateOrmDevJsonRpcService()
-
-
Method Details
-
getInfo
-
getNumberOfPersistenceUnits
public int getNumberOfPersistenceUnits() -
getNumberOfEntityTypes
public int getNumberOfEntityTypes() -
getNumberOfNamedQueries
public int getNumberOfNamedQueries() -
executeHQL
public CompletionStage<Map<String,String>> executeHQL(String persistenceUnit, String query, Integer pageNumber, Integer pageSize, Boolean assistant, Boolean interactive) Execute an arbitraryhqlquery in the givenpersistence unit. The query might be both a selection or a mutation statement. For selection queries, the result count is retrieved though a count query and the results, paginated based on pageNumber and pageSize are returned. For mutation statements, a custom message including the number of affected records is returned.This method handles result serialization (to JSON) internally, and returns a JsonRpc Message in Map format to avoid further processing by the Dev UI JsonRpcRouter.
- Parameters:
persistenceUnit- The name of the persistence unit within which the query will be executedquery- The user query (be it an HQL query or a plain-text statement when using assistant)pageNumber- The page number, used for selection query results paginationpageSize- The page size, used for selection query results paginationassistant- Whether to use the assistant to generate the HQL query based on the user inputinteractive- Enable assistant's interactive mode, answering the original user request in natural language- Returns:
- a JsonRpcMessage containing the resulting
HibernateOrmDevJsonRpcService.DataSetserialized to JSON.
-