com.jenkov.mrpersister.impl.command
Class DaoCommandExecutorUnchecked

java.lang.Object
  extended by com.jenkov.mrpersister.impl.command.DaoCommandExecutorUnchecked
All Implemented Interfaces:
IDaoCommandExecutorUnchecked

public class DaoCommandExecutorUnchecked
extends java.lang.Object
implements IDaoCommandExecutorUnchecked

Author:
Jakob Jenkov - Copyright 2005 Jenkov Development

Field Summary
protected  PersistenceManager persistenceManager
           
 
Constructor Summary
DaoCommandExecutorUnchecked(PersistenceManager manager)
           
 
Method Summary
 java.lang.Object execute(IDaoCommand command)
          Obtains a connection from the default data source, executes this dao command and closes the connection afterwards.
 java.lang.Object execute(IDaoCommand command, java.sql.Connection connection)
          Executes this dao command using the given connection, and closes the connection afterwards.
 java.lang.Object execute(java.lang.Object configKey, IDaoCommand command)
          Obtains a connection from the data source set on the IPersistenceConfiguration stored by the given configKey (in the persistence managers config factory), executes this dao command and closes the connection afterwards.
 java.lang.Object execute(java.lang.Object configKey, IDaoCommand command, java.sql.Connection connection)
          Executes this dao command using the given connection and persistence configuration stored by the given config key, and closes the connection afterwards.
 java.lang.Object executeTransaction(IDaoCommand command)
          Obtains a connection from the default data source, sets auto commit to false, executes the dao command and tries to commit the transaction.
 java.lang.Object executeTransaction(IDaoCommand command, java.sql.Connection connection)
          Executes the dao command using the given connection, and tries to commit the transaction.
 java.lang.Object executeTransaction(java.lang.Object config, IDaoCommand command)
          Obtains a connection from the data source set on the IPersistenceConfiguration stored by the given configKey (in the persistence managers config factory), sets auto commit to false, executes the dao command and tries to commit the transaction.
 java.lang.Object executeTransaction(java.lang.Object config, IDaoCommand command, java.sql.Connection connection)
          Executes the dao command using the given connection, and tries to commit the transaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

persistenceManager

protected PersistenceManager persistenceManager
Constructor Detail

DaoCommandExecutorUnchecked

public DaoCommandExecutorUnchecked(PersistenceManager manager)
Method Detail

execute

public java.lang.Object execute(IDaoCommand command)
Description copied from interface: IDaoCommandExecutorUnchecked
Obtains a connection from the default data source, executes this dao command and closes the connection afterwards.

Specified by:
execute in interface IDaoCommandExecutorUnchecked
Parameters:
command - The dao command to execute.
Returns:
The object returned by the IDaoCommand.execute() call.

execute

public java.lang.Object execute(IDaoCommand command,
                                java.sql.Connection connection)
Description copied from interface: IDaoCommandExecutorUnchecked
Executes this dao command using the given connection, and closes the connection afterwards.

Specified by:
execute in interface IDaoCommandExecutorUnchecked
Parameters:
command - The dao command to execute.
connection - The connection the dao command uses during execution.
Returns:
The object returned by the IDaoCommand.execute() call.

execute

public java.lang.Object execute(java.lang.Object configKey,
                                IDaoCommand command)
Description copied from interface: IDaoCommandExecutorUnchecked
Obtains a connection from the data source set on the IPersistenceConfiguration stored by the given configKey (in the persistence managers config factory), executes this dao command and closes the connection afterwards.

Specified by:
execute in interface IDaoCommandExecutorUnchecked
Parameters:
configKey - The key of the IPersistenceConfiguration to get the data source from.
command - The dao command to execute.
Returns:
The object returned by the IDaoCommand.execute() call.

execute

public java.lang.Object execute(java.lang.Object configKey,
                                IDaoCommand command,
                                java.sql.Connection connection)
Description copied from interface: IDaoCommandExecutorUnchecked
Executes this dao command using the given connection and persistence configuration stored by the given config key, and closes the connection afterwards.

Specified by:
execute in interface IDaoCommandExecutorUnchecked
Parameters:
configKey - The key of the IPersistenceConfiguration to get the data source from.
command - The dao command to execute.
connection - The connection the dao command uses during execution.
Returns:
The object returned by the IDaoCommand.execute() call.

executeTransaction

public java.lang.Object executeTransaction(IDaoCommand command)
Description copied from interface: IDaoCommandExecutorUnchecked
Obtains a connection from the default data source, sets auto commit to false, executes the dao command and tries to commit the transaction. If an exception is thrown from the dao commands execute() method the transaction will be aborted (rolled back). The connection is closed after commit/rollback.

Specified by:
executeTransaction in interface IDaoCommandExecutorUnchecked
Returns:
The object returned by the IDaoCommand.execute() call.

executeTransaction

public java.lang.Object executeTransaction(IDaoCommand command,
                                           java.sql.Connection connection)
Description copied from interface: IDaoCommandExecutorUnchecked
Executes the dao command using the given connection, and tries to commit the transaction. If an exception is thrown from the dao commands execute() method the transaction will be aborted (rolled back). The connection is closed after commit/rollback.

Specified by:
executeTransaction in interface IDaoCommandExecutorUnchecked
Parameters:
command - The command to execute.
connection - The connection the dao command uses during execution.
Returns:
The object returned by the IDaoCommand.execute() call.

executeTransaction

public java.lang.Object executeTransaction(java.lang.Object config,
                                           IDaoCommand command)
Description copied from interface: IDaoCommandExecutorUnchecked
Obtains a connection from the data source set on the IPersistenceConfiguration stored by the given configKey (in the persistence managers config factory), sets auto commit to false, executes the dao command and tries to commit the transaction. If an exception is thrown from the dao commands execute() method the transaction will be aborted (rolled back). The connection is closed after commit/rollback.

Specified by:
executeTransaction in interface IDaoCommandExecutorUnchecked
command - The command to execute.
Returns:
The object returned by the IDaoCommand.execute() call.

executeTransaction

public java.lang.Object executeTransaction(java.lang.Object config,
                                           IDaoCommand command,
                                           java.sql.Connection connection)
Description copied from interface: IDaoCommandExecutorUnchecked
Executes the dao command using the given connection, and tries to commit the transaction. If an exception is thrown from the dao commands execute() method the transaction will be aborted (rolled back). The connection is closed after commit/rollback.

Specified by:
executeTransaction in interface IDaoCommandExecutorUnchecked
command - The command to execute.
connection - The connection the dao command uses during execution.
Returns:
The object returned by the IDaoCommand.execute() call.