Package org.ametys.core.datasource
Class AbstractMyBatisDAO
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.datasource.AbstractMyBatisDAO
-
- All Implemented Interfaces:
LogEnabled
,PluginAware
,Component
,Configurable
,Contextualizable
,Serviceable
- Direct Known Subclasses:
ApogeeDAO
,JdbcProfileAssignmentStorage
,ResourceAccessComponent
,ResourceAccessComponent
,ResourceStatisticsComponent
,RightProfilesDAO
,SQLCollectionDAO
,SQLUserSearchDAO
,SubscribersDAO
,SurveyAnswerDao
,UserSignupManager
public abstract class AbstractMyBatisDAO extends AbstractLogEnabled implements Contextualizable, Serviceable, PluginAware, Configurable, Component
Interface to be implemented by any object that wishes to have access to one or multiple SqlMapClient.
-
-
Field Summary
Fields Modifier and Type Field Description protected ServiceManager
_manager
The service manager
-
Constructor Summary
Constructors Constructor Description AbstractMyBatisDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_configureDatasource(Configuration configuration)
Configure datasourceprotected String
_getDataSourceId()
Get datasource idprotected org.apache.ibatis.session.Configuration
_getMyBatisConfiguration(org.apache.ibatis.mapping.Environment env)
Get the mybatis configurationvoid
configure(Configuration configuration)
void
contextualize(Context context)
protected org.apache.ibatis.session.SqlSession
getSession()
Returns the myBatisSqlSession
.protected org.apache.ibatis.session.SqlSession
getSession(boolean autoCommit)
Returns the myBatisSqlSession
.protected void
reload()
Reload configuration and object for mybatisvoid
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.-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_manager
protected ServiceManager _manager
The service manager
-
-
Constructor Detail
-
AbstractMyBatisDAO
public AbstractMyBatisDAO()
-
-
Method Detail
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
setPluginInfo
public void setPluginInfo(String pluginName, String featureName, String id)
Description copied from interface:PluginAware
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.- Specified by:
setPluginInfo
in interfacePluginAware
- Parameters:
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this component
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
_configureDatasource
protected void _configureDatasource(Configuration configuration) throws ConfigurationException
Configure datasource- Parameters:
configuration
- the configuration- Throws:
ConfigurationException
- if an error occurred
-
reload
protected void reload()
Reload configuration and object for mybatis
-
_getMyBatisConfiguration
protected org.apache.ibatis.session.Configuration _getMyBatisConfiguration(org.apache.ibatis.mapping.Environment env)
Get the mybatis configuration- Parameters:
env
- the mybatis environnement- Returns:
- the mybatis configuration
-
_getDataSourceId
protected String _getDataSourceId()
Get datasource id- Returns:
- the datasource id
-
getSession
protected org.apache.ibatis.session.SqlSession getSession()
Returns the myBatisSqlSession
.- Returns:
- the myBatis
SqlSession
.
-
getSession
protected org.apache.ibatis.session.SqlSession getSession(boolean autoCommit)
Returns the myBatisSqlSession
.- Parameters:
autoCommit
- if the underlying Connection should auto commit statements.- Returns:
- the myBatis
SqlSession
.
-
-