Class DefaultSessionUtils

    • Constructor Detail

      • DefaultSessionUtils

        public DefaultSessionUtils()
    • Method Detail

      • withTransaction

        public <V> V withTransaction​(java.util.function.Supplier<V> supplier)
        Description copied from interface: SessionUtils
        Invoked the given supplier within the context of a transaction.
        Specified by:
        withTransaction in interface SessionUtils
        Type Parameters:
        V - type returned by the supplier
        Parameters:
        supplier - supplier to invoke
        Returns:
        value returned by the supplier
      • withReadOnlyTransaction

        public <V> V withReadOnlyTransaction​(java.util.function.Supplier<V> supplier)
        Description copied from interface: SessionUtils
        Invokes the given supplier within the context of a read-only transaction.
        Specified by:
        withReadOnlyTransaction in interface SessionUtils
        Type Parameters:
        V - type returned by the supplier
        Parameters:
        supplier - supplier to invoke
        Returns:
        value returned by the supplier
      • withManualFlush

        public <V> V withManualFlush​(java.util.function.Supplier<V> supplier)
        Description copied from interface: SessionUtils
        Converts the flush mode for the current session factory to MANUAL for the duration of the call to the given supplier. The flush mode is reverted to it's previous value after the call.
        Specified by:
        withManualFlush in interface SessionUtils
        Type Parameters:
        V - type returned by the supplier
        Parameters:
        supplier - supplier to invoke
        Returns:
        value returned by the supplier