com.jenkov.mrpersister.itf
Interface IPersistenceConfigurationFactory

All Known Implementing Classes:
PersistenceConfigurationFactory

public interface IPersistenceConfigurationFactory

Author:
Jakob Jenkov - Copyright 2005 Jenkov Development

Method Summary
 IPersistenceConfiguration createConfiguration()
          Creates a new persistence configuration targeted at the default database (any JDBC compliant database).
 IPersistenceConfiguration createConfiguration(Database database)
          Creates a new persistence configuration.
 IPersistenceConfiguration getConfiguration(java.lang.Object configurationKey)
          Returns the IPersistenceConfiguration stored by the given key.
 IPersistenceConfiguration getOrCreateConfiguration(java.lang.Object configurationKey)
          Returns the IPersistenceConfiguration instance stored by the given key.
 IPersistenceConfiguration getOrCreateConfiguration(java.lang.Object configurationKey, Database database)
          Returns the IPersistenceConfiguration instance stored by the given key.
 void removeConfiguration(java.lang.Object configurationKey)
          Removes the IPersistenceConfiguration stored by the given key.
 void storeConfiguration(java.lang.Object configurationKey, IPersistenceConfiguration configuration)
          Stores the IPersistenceConfiguration by given key.
 

Method Detail

createConfiguration

IPersistenceConfiguration createConfiguration()
Creates a new persistence configuration targeted at the default database (any JDBC compliant database).

Returns:
a new persistence configuration targeted at the default database.

createConfiguration

IPersistenceConfiguration createConfiguration(Database database)
Creates a new persistence configuration. Used internally by Mr. Persister.

Parameters:
database - The database is the database the configuration should be targeted at.
Returns:
A new persistence configuration.

getOrCreateConfiguration

IPersistenceConfiguration getOrCreateConfiguration(java.lang.Object configurationKey)
Returns the IPersistenceConfiguration instance stored by the given key. If none is stored a new will be created and stored by the key for later use.

Parameters:
configurationKey - The key of the persistence configuration to get, or to store it by if a new instance is created.
Returns:
The persistence configuration stored by the given key.

getOrCreateConfiguration

IPersistenceConfiguration getOrCreateConfiguration(java.lang.Object configurationKey,
                                                   Database database)
Returns the IPersistenceConfiguration instance stored by the given key. If none is stored a new will be created and stored by the key for later use.

Parameters:
configurationKey - The key of the persistence configuration to get, or to store it by if a new instance is created.
database - The database to target this configuration for.
Returns:
The persistence configuration stored by the given key.

getConfiguration

IPersistenceConfiguration getConfiguration(java.lang.Object configurationKey)
Returns the IPersistenceConfiguration stored by the given key.

Parameters:
configurationKey - The key of the configuration instance to get.
Returns:
the IPersistenceConfiguration stored by the given key.

storeConfiguration

void storeConfiguration(java.lang.Object configurationKey,
                        IPersistenceConfiguration configuration)
Stores the IPersistenceConfiguration by given key.

Parameters:
configurationKey - The key to store the configuration instance by.
configuration - The configuration to store.

removeConfiguration

void removeConfiguration(java.lang.Object configurationKey)
Removes the IPersistenceConfiguration stored by the given key.

Parameters:
configurationKey - The key of the persistence configuration to remove.