Class HibernateOrmDevJsonRpcService

java.lang.Object
io.quarkus.hibernate.orm.dev.ui.HibernateOrmDevJsonRpcService

public class HibernateOrmDevJsonRpcService extends Object
  • Field Details

    • assistant

      @Inject jakarta.enterprise.inject.Instance<Optional<io.quarkus.assistant.runtime.dev.Assistant>> assistant
  • Constructor Details

    • HibernateOrmDevJsonRpcService

      public HibernateOrmDevJsonRpcService()
  • Method Details

    • getInfo

      public HibernateOrmDevInfo 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 arbitrary hql query in the given persistence 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 executed
      query - 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 pagination
      pageSize - The page size, used for selection query results pagination
      assistant - Whether to use the assistant to generate the HQL query based on the user input
      interactive - Enable assistant's interactive mode, answering the original user request in natural language
      Returns:
      a JsonRpcMessage containing the resulting HibernateOrmDevJsonRpcService.DataSet serialized to JSON.