public abstract class AbstractMyBatisDAO extends AbstractLogEnabled implements Contextualizable, Serviceable, PluginAware, Configurable, Component
Modifier and Type | Class and Description |
---|---|
(package private) class |
AbstractMyBatisDAO.SqlMap |
Modifier and Type | Field and Description |
---|---|
private String |
_contextPath |
private boolean |
_dataSourceConfigurationParameter |
private String |
_dataSourceId |
private String |
_dataSourceParameter |
protected ServiceManager |
_manager
The service manager
|
private String |
_pluginName |
private SqlSessionFactory |
_sessionFactory |
private SQLDataSourceManager |
_sqlDataSourceManager |
private Set<AbstractMyBatisDAO.SqlMap> |
_sqlMaps |
Constructor and Description |
---|
AbstractMyBatisDAO() |
Modifier and Type | Method and Description |
---|---|
protected void |
_configureDatasource(Configuration configuration)
Configure datasource
|
protected String |
_getDataSourceId()
Get datasource id
|
protected Configuration |
_getMyBatisConfiguration(Environment env)
Get the mybatis configuration
|
private void |
_initializeXMLMapper(InputStream mapperStream,
String mapperLocation,
Configuration config) |
void |
configure(Configuration configuration) |
void |
contextualize(Context context) |
protected SqlSession |
getSession()
Returns the myBatis
SqlSession . |
protected SqlSession |
getSession(boolean autoCommit)
Returns the myBatis
SqlSession . |
private SQLDataSourceManager |
getSQLDataSourceManager() |
protected void |
reload()
Reload configuration and object for mybatis
|
void |
service(ServiceManager manager) |
void |
setPluginInfo(String pluginName,
String featureName,
String id)
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level. |
getLogger, setLogger
protected ServiceManager _manager
private SqlSessionFactory _sessionFactory
private SQLDataSourceManager _sqlDataSourceManager
private String _contextPath
private String _pluginName
private String _dataSourceId
private String _dataSourceParameter
private boolean _dataSourceConfigurationParameter
private Set<AbstractMyBatisDAO.SqlMap> _sqlMaps
public AbstractMyBatisDAO()
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
private SQLDataSourceManager getSQLDataSourceManager()
public void setPluginInfo(String pluginName, String featureName, String id)
PluginAware
setPluginInfo
in interface PluginAware
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this componentpublic void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
ConfigurationException
protected void _configureDatasource(Configuration configuration) throws ConfigurationException
configuration
- the configurationConfigurationException
- if an error occurredprotected void reload()
private void _initializeXMLMapper(InputStream mapperStream, String mapperLocation, Configuration config)
protected Configuration _getMyBatisConfiguration(Environment env)
env
- the mybatis environnementprotected String _getDataSourceId()
protected SqlSession getSession()
SqlSession
.SqlSession
.protected SqlSession getSession(boolean autoCommit)
SqlSession
.autoCommit
- if the underlying Connection should auto commit statements.SqlSession
.