Interface Stage


  • public interface Stage
    An API for Hibernate Reactive where non-blocking operations are represented by a Java CompletionStage.

    The Stage.Query, Stage.Session, and Stage.SessionFactory interfaces declared here are simply non-blocking counterparts to the similarly-named interfaces in Hibernate ORM.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static interface  Stage.Closeable
      An object whose Stage.Closeable.close() method returns a CompletionStage.
      static interface  Stage.Query<R>
      A non-blocking counterpart to the Hibernate Query interface, allowing reactive execution of HQL and JPQL queries.
      static interface  Stage.Session
      A non-blocking counterpart to the Hibernate Session interface, allowing a reactive style of interaction with the database.
      static interface  Stage.SessionFactory
      Factory for reactive sessions.
      static interface  Stage.StatelessSession
      A non-blocking counterpart to the Hibernate StatelessSession interface, which provides a command-oriented API for performing bulk operations against a database.
      static interface  Stage.Transaction
      Allows code within Stage.Session.withTransaction(Function) to mark a transaction for rollback.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Log LOG  
    • Method Summary

      Static Methods 
      Modifier and Type Method Description
      static <T> java.util.concurrent.CompletionStage<T> fetch​(T association)
      Asynchronously fetch an association that's configured for lazy loading.
    • Field Detail

      • LOG

        static final Log LOG
    • Method Detail

      • fetch

        static <T> java.util.concurrent.CompletionStage<T> fetch​(T association)
        Asynchronously fetch an association that's configured for lazy loading.
         Stage.fetch(author.getBook()).thenAccept(book -> print(book.getTitle()));
         
        Parameters:
        association - a lazy-loaded association
        Returns:
        the fetched association, via a CompletionStage
        See Also:
        Hibernate.initialize(Object)