com.jenkov.mrpersister.impl.command
Class DaosFactory

java.lang.Object
  extended by com.jenkov.mrpersister.impl.command.DaosFactory
All Implemented Interfaces:
IDaosFactory

public class DaosFactory
extends java.lang.Object
implements IDaosFactory

Author:
Jakob Jenkov - Copyright 2005 Jenkov Development

Constructor Summary
DaosFactory(PersistenceManager persistenceManager)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DaosFactory

public DaosFactory(PersistenceManager persistenceManager)
Method Detail

createDaos

public IDaos createDaos()
                 throws PersistenceException
Description copied from interface: IDaosFactory
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.

Specified by:
createDaos in interface IDaosFactory
Returns:
An IDaos instance.
Throws:
PersistenceException - If no valid DataSource is set on the PersistenceManager.

createDaos

public IDaos createDaos(java.sql.Connection connection)
Description copied from interface: IDaosFactory
Creates an IDaos instance containing the given connection. The IDaos will use the default PersistenceConfiguration of the PersistenceManager.

Specified by:
createDaos in interface IDaosFactory
Parameters:
connection - The connection to use with the IDaos instance.
Returns:
An IDaos instance.

createDaos

public IDaos createDaos(java.lang.Object configKey)
                 throws PersistenceException
Description copied from interface: IDaosFactory
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.

Specified by:
createDaos in interface IDaosFactory
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

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

Specified by:
createDaos in interface IDaosFactory
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

public IDaos createDaos(IPersistenceConfiguration configuration)
                 throws PersistenceException
Description copied from interface: IDaosFactory
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.

Specified by:
createDaos in interface IDaosFactory
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

public IDaos createDaos(IPersistenceConfiguration configuration,
                        java.sql.Connection connection)
Description copied from interface: IDaosFactory
Creates an IDaos instance that uses the given connection and IPersistenceConfiguration for its actions.

Specified by:
createDaos in interface IDaosFactory
Parameters:
configuration - The IPersistenceConfiguration to be used by this IDaos instance.
Returns:
An IDaos instance.