com.jenkov.mrpersister.itf.command
Interface IDaosFactory

All Known Implementing Classes:
DaosFactory

public interface IDaosFactory

Author:
Jakob Jenkov - Copyright 2005 Jenkov Development

Method Summary
 IDaos createDaos()
          Creates an IDaos instance containing a connection obtained from the default DataSource set on the PersistenceManager this IDaosFactory belongs to.
 IDaos createDaos(java.sql.Connection connection)
          Creates an IDaos instance containing the given connection.
 IDaos createDaos(IPersistenceConfiguration configuration)
          Creates an IDaos instance that uses the given IPersistenceConfiguration for its actions.
 IDaos createDaos(IPersistenceConfiguration configuration, java.sql.Connection connection)
          Creates an IDaos instance that uses the given connection and IPersistenceConfiguration for its actions.
 IDaos createDaos(java.lang.Object configKey)
          Creates an IDaos instance containing a connection obtained from the DataSource set on the IPersistenceConfiguration stored in the persistence configuration factory by the given key.
 IDaos createDaos(java.lang.Object configKey, java.sql.Connection connection)
          Creates an IDaos instance containing the given connection.
 

Method Detail

createDaos

IDaos createDaos()
                 throws PersistenceException
Creates an IDaos instance containing a connection obtained from the default DataSource set on the PersistenceManager this IDaosFactory belongs to. The IDaos instance will use the default PersistenceConfiguration of the PersistenceManager.

Returns:
An IDaos instance.
Throws:
PersistenceException - If no valid DataSource is set on the PersistenceManager.

createDaos

IDaos createDaos(java.sql.Connection connection)
Creates an IDaos instance containing the given connection. The IDaos will use the default PersistenceConfiguration of the PersistenceManager.

Parameters:
connection - The connection to use with the IDaos instance.
Returns:
An IDaos instance.

createDaos

IDaos createDaos(java.lang.Object configKey)
                 throws PersistenceException
Creates an IDaos instance containing a connection obtained from the DataSource set on the IPersistenceConfiguration stored in the persistence configuration factory by the given key. The persistence configuration factory is also stored in the PersistenceManager like this IDaosFactory is. The IDaos will use the same IPersistenceConfiguration for its other functions.

Parameters:
configKey - The key by which the IPersistenceConfiguration to use is stored in the persistence configuration factory. The DataSource set on this IPersistenceConfiguration is used to obtain the connection used by the IDaos instance.
Returns:
Throws:
PersistenceException

createDaos

IDaos createDaos(java.lang.Object configKey,
                 java.sql.Connection connection)
Creates an IDaos instance containing the given connection. The IDaos will use the IPersistenceConfiguration stored by the given config key for its other functions.

Parameters:
configKey - The key by which the IPersistenceConfiguration to use is stored in persistence configuration factory in the PersistenceManager.
connection - The connection to use by the IDaos instance.
Returns:
An IDaos instance.

createDaos

IDaos createDaos(IPersistenceConfiguration configuration)
                 throws PersistenceException
Creates an IDaos instance that uses the given IPersistenceConfiguration for its actions. The DataSource set on this IPersistenceConfiguration is used to obtain the connection to be used by this IDaos instance.

Parameters:
configuration - The IPersistenceConfiguration to be used by this IDaos instance.
Returns:
An IDaos instance.
Throws:
PersistenceException - If no DataSource is set on the given IPersistenceConfiguration

createDaos

IDaos createDaos(IPersistenceConfiguration configuration,
                 java.sql.Connection connection)
Creates an IDaos instance that uses the given connection and IPersistenceConfiguration for its actions.

Parameters:
configuration - The IPersistenceConfiguration to be used by this IDaos instance.
Returns:
An IDaos instance.