Package io.micronaut.data.connection
Interface ConnectionOperations<C>
- Type Parameters:
- C- The connection type.
- All Known Subinterfaces:
- DataSourceConnectionOperations,- MongoConnectionOperations
- All Known Implementing Classes:
- AbstractConnectionOperations,- DefaultDataSourceConnectionOperations,- HibernateConnectionConnectionOperations,- HibernateConnectionOperations,- SpringHibernateConnectionOperations,- SpringJdbcConnectionOperations,- SynchronousConnectionOperationsFromReactiveConnectionOperations
public interface ConnectionOperations<C>
The synchronous connection operations interface.
- Since:
- 4.0.0
- Author:
- Denis Stepanov
- 
Method SummaryModifier and TypeMethodDescription<R> Rexecute(@NonNull ConnectionDefinition definition, @NonNull Function<ConnectionStatus<C>, R> callback) Execute a connection within the context of the function.default <R> RexecuteRead(@NonNull Function<ConnectionStatus<C>, R> callback) Execute a read-only connection within the context of the function.default <R> RexecuteWrite(@NonNull Function<ConnectionStatus<C>, R> callback) Execute a write supported connection within the context of the function.Obtains the current connection.default @NonNull ConnectionStatus<C>Obtains the current required connection.
- 
Method Details- 
getConnectionStatusObtains the current required connection.- Returns:
- The connection or exception if the connection doesn't exist
 
- 
findConnectionStatusOptional<ConnectionStatus<C>> findConnectionStatus()Obtains the current connection.- Returns:
- The optional connection
 
- 
execute<R> R execute(@NonNull @NonNull ConnectionDefinition definition, @NonNull @NonNull Function<ConnectionStatus<C>, R> callback) Execute a connection within the context of the function.- Type Parameters:
- R- The result
- Parameters:
- definition- The connection definition
- callback- The call back
- Returns:
- The result
 
- 
executeReadExecute a read-only connection within the context of the function. NOTE: The connection manager might not support the read only connection!- Type Parameters:
- R- The result
- Parameters:
- callback- The call back
- Returns:
- The result
 
- 
executeWriteExecute a write supported connection within the context of the function.- Type Parameters:
- R- The result
- Parameters:
- callback- The call back
- Returns:
- The result
 
 
-