|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IPersistenceConfiguration
This interface represents a persistence configuration which is a collection of Mr. Persister compononents used to achieve persistence in a certain way. You can have different persistence configurations suiting different databases or situations etc if helps you. The persistence configuration also makes it easier to pass around all the different components to be used in a specific situation, for instance read-by-primary-key, or inser / updateBatch / delete etc.
Method Summary | |
---|---|
java.lang.Object |
getConfigurationKey()
Returns the key by which this persistence configuration is stored internally in the MrPersister class. |
ICustomObjectMapper |
getCustomObjectMapper()
Returns the custom object mapper of this persistence configuration. |
Database |
getDatabase()
Returns the Database instance representing the database this instance
is specialized for. |
javax.sql.DataSource |
getDataSource()
Gets the data source associated with this persistence configuration. |
ISqlCache |
getDeleteSqlCache()
Returns the SQL cache used to store delete statements in this persistence configuration. |
ISqlCache |
getInsertSqlCache()
Returns the SQL cache used to store insert SQL statements in this persistence configuration. |
IObjectMapper |
getObjectMapper()
Returns the object mapper used in this persistence configuration. |
IObjectMappingCache |
getObjectMappingCache()
Returns the object mapping cache used in this persistence configuration. |
IObjectReader |
getObjectReader()
Returns the object reader used in this persistence configuration. |
IObjectWriter |
getObjectWriter()
Returns the object writer used in this persistence configuration. |
ISqlCache |
getReadByPrimaryKeySqlCache()
Returns the SQL cache used to store read-by-primary-key SQL statements in this persistence configuration. |
IScopeFactory |
getScopeFactory()
Returns the scope factory matching the data source set on this persistence configuration. |
ISqlGenerator |
getSqlGenerator()
Returns the SQL generator used with this persistence configuration. |
ISqlCache |
getUpdateOptimisticSqlCache()
Returns the SQL cache used to store updateOptimistic SQL statements in this persistence configuration. |
ISqlCache |
getUpdateSqlCache()
Returns the SQL cache used to store updateBatch SQL statements in this persistence configuration. |
void |
setConfigurationKey(java.lang.Object key)
Sets the key by which this persistence configuration is stored internally in the MrPersister class. |
void |
setCustomObjectMapper(ICustomObjectMapper customMapper)
Sets the custom object mapper of this persistence configuration. |
void |
setDatabase(Database database)
Sets the database this configuration is specialized for. |
void |
setDataSource(javax.sql.DataSource dataSource)
Sets the data source associated with this persistence configuration. |
void |
setDeleteSqlCache(ISqlCache cache)
Sets the SQL cache to be used to store delete SQL statements in this persistence configuration. |
void |
setInsertSqlCache(ISqlCache cache)
Sets the SQL cache to be used to store insert SQL statements in this persistence configuration. |
void |
setObjectMapper(IObjectMapper mapper)
Sets the object mapper to be used with this persistence configuration. |
void |
setObjectMappingCache(IObjectMappingCache cache)
Sets the object mapping cache to be used in this persistence configuration. |
void |
setObjectReader(IObjectReader reader)
Sets the object reader to be used with this persistence configuration. |
void |
setObjectWriter(IObjectWriter writer)
Sets the object writer to use with this persistence configuration. |
void |
setReadByPrimaryKeySqlCache(ISqlCache cache)
Sets the SQL cache to be used to store read-by-primary-key SQL statements in this persistence configuration. |
void |
setSqlGenerator(ISqlGenerator generator)
Sets the SQL generator to be used with this persistence configuration. |
void |
setUpdateOptimisticSqlCache(ISqlCache cache)
Sets the SQL cache to be used to store updateOptimistic SQL statements in this persistence configuration. |
void |
setUpdateSqlCache(ISqlCache cache)
Sets the SQL cache to be used to store updateBatch SQL statements in this persistence configuration. |
void |
update()
Updates the MrPersister class with any changes made to this IPersistenceConfiguration . |
Method Detail |
---|
Database getDatabase()
Database
instance representing the database this instance
is specialized for.
Database
instance represeting the database this instance
is specialized for.void setDatabase(Database database)
javax.sql.DataSource getDataSource()
void setDataSource(javax.sql.DataSource dataSource)
IScopeFactory getScopeFactory()
java.lang.Object getConfigurationKey()
void setConfigurationKey(java.lang.Object key)
IPersistenceConfiguration
instance will not
remap the instance stored in the MrPersister class. You will have to
remove the previously stored IPersistenceConfiguration
yourself.
IPersistenceConfiguration
instance will however store that instance by the new key. But the instance will
remain mapped to the old key as well in the MrPersister class.
key
- key by which this persistence configuration is stored internally
in the MrPersister class, until you specifically remove that instance
from the MrPersister class.void update()
IPersistenceConfiguration
. This method must be called whenever
changes have been made to any of the objects stored in this persistence configuration.
This must be done to assure that changes to a persistence configuration by one
thread, are also visible to other threads using it.
This does not include objects inserted or removed from the various caches, as these
are already prepared to handle concurrency. Only changes to the other components, or
if components in this persistence configuraion are replaced by others.
IObjectMapper getObjectMapper()
IObjectMapper
instance set in this persistence configuration.void setObjectMapper(IObjectMapper mapper)
mapper
- The IObjectMapper
instance to use with this persistence configuration.IObjectMappingCache getObjectMappingCache()
IObjectMappingCache
instance set in this persistence configuration.void setObjectMappingCache(IObjectMappingCache cache)
cache
- The IObjectMappingCache
instance to use in this persistence configuration.IObjectReader getObjectReader()
IObjectReader
instance set in this persistence configuration.void setObjectReader(IObjectReader reader)
reader
- The IObjectReader
instance to use with this persistence configurationIObjectWriter getObjectWriter()
IObjectWriter
instance set in this persistence configuration.void setObjectWriter(IObjectWriter writer)
writer
- The IObjectWriter
instance to use with this persistence configuration.ISqlGenerator getSqlGenerator()
ISqlGenerator
instance set in this persistence configuration.void setSqlGenerator(ISqlGenerator generator)
generator
- The ISqlGenerator
instance to be used with this persistence configuration.ISqlCache getReadByPrimaryKeySqlCache()
ISqlCache
instance used to store read-by-primary-key SQL statements in
this persistence configuration.void setReadByPrimaryKeySqlCache(ISqlCache cache)
cache
- The ISqlCache
instance to be used to store read-by-primary-key SQL statements
in this persistence configuration.ISqlCache getInsertSqlCache()
ISqlCache
instance used to store insert SQL statements in
this persistence configuration.void setInsertSqlCache(ISqlCache cache)
cache
- The ISqlCache
instance to be used to store insert SQL statements
in this persistence configuration.ISqlCache getUpdateSqlCache()
ISqlCache
instance used to store updateBatch SQL statements in
this persistence configuration.void setUpdateSqlCache(ISqlCache cache)
cache
- The ISqlCache
instance to be used to store updateBatch SQL statements
in this persistence configuration.ISqlCache getUpdateOptimisticSqlCache()
ISqlCache
instance used to store updateOptimistic SQL statements in
this persistence configuration.void setUpdateOptimisticSqlCache(ISqlCache cache)
cache
- The ISqlCache
instance to be used to store updateOptimistic SQL statements
in this persistence configuration.ISqlCache getDeleteSqlCache()
ISqlCache
instance used to store delete SQL statements in
this persistence configuration.void setDeleteSqlCache(ISqlCache cache)
cache
- The ISqlCache
instance to be used to store delete SQL statements
in this persistence configuration.ICustomObjectMapper getCustomObjectMapper()
void setCustomObjectMapper(ICustomObjectMapper customMapper)
customMapper
- The custom object mapper to set on this persistence configuration.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |