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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
_configureDatasource
(Configuration configuration) Configure datasourceprotected String
Get datasource idprotected Configuration
Get the mybatis configurationvoid
configure
(Configuration configuration) void
contextualize
(Context context) protected SqlSession
Returns the myBatisSqlSession
.protected 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 Details
-
_manager
The service manager
-
-
Constructor Details
-
AbstractMyBatisDAO
public AbstractMyBatisDAO()
-
-
Method Details
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
setPluginInfo
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
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
_configureDatasource
Configure datasource- Parameters:
configuration
- the configuration- Throws:
ConfigurationException
- if an error occurred
-
reload
Reload configuration and object for mybatis -
_getMyBatisConfiguration
Get the mybatis configuration- Parameters:
env
- the mybatis environnement- Returns:
- the mybatis configuration
-
_getDataSourceId
Get datasource id- Returns:
- the datasource id
-
getSession
Returns the myBatisSqlSession
.- Returns:
- the myBatis
SqlSession
.
-
getSession
Returns the myBatisSqlSession
.- Parameters:
autoCommit
- if the underlying Connection should auto commit statements.- Returns:
- the myBatis
SqlSession
.
-