public class StaticSQLDatabaseType extends AbstractLogEnabled implements Configurable, SQLDatabaseType, PluginAware
SQLDatabaseType
.Modifier and Type | Field and Description |
---|---|
protected String |
_driver
The driver of the database type
|
protected I18nizableText |
_driverNotFoundMessage
The driver not found message
|
protected String |
_id
The id of the database type
|
protected I18nizableText |
_label
The label of the database type
|
protected String |
_languageEscapeTableNameTemplate
The template to escape the table name.
|
protected String |
_languageLimitQueryTemplate
The template to limit the query to a limit/offset.
|
protected String |
_pluginName
The plugin's name
|
protected String |
_template
The url template for this database type
|
protected String |
_validationQuery
The SQL query to validate the connection is still alive
|
Constructor and Description |
---|
StaticSQLDatabaseType() |
Modifier and Type | Method and Description |
---|---|
void |
configure(Configuration configuration) |
String |
getDriver()
Get the driver of the database type.
|
I18nizableText |
getDriverNotFoundMessage()
Get the error message key when the specified driver was not found
|
String |
getId()
Get the id of the database type.
|
I18nizableText |
getLabel()
Get the label of the database type.
|
String |
getTemplate()
Get the url template to use for this database type
|
String |
getValidationQuery()
Get the query to validate a connection
|
String |
languageEscapeTableName(String tableNameToEscape)
Some db systems requires the table names to be escaped
|
String |
languageLimitQuery(String queryToLimit,
String limit,
String offset)
Add a limit/offset element to the given query
|
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 I18nizableText _label
protected String _pluginName
protected String _validationQuery
protected I18nizableText _driverNotFoundMessage
protected String _languageEscapeTableNameTemplate
protected String _languageLimitQueryTemplate
public StaticSQLDatabaseType()
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
public String getId()
SQLDatabaseType
getId
in interface SQLDatabaseType
public I18nizableText getLabel()
SQLDatabaseType
getLabel
in interface SQLDatabaseType
public String getDriver()
SQLDatabaseType
getDriver
in interface SQLDatabaseType
public String getTemplate()
SQLDatabaseType
getTemplate
in interface SQLDatabaseType
public String getValidationQuery()
SQLDatabaseType
getValidationQuery
in interface SQLDatabaseType
public I18nizableText getDriverNotFoundMessage()
SQLDatabaseType
getDriverNotFoundMessage
in interface SQLDatabaseType
public String languageEscapeTableName(String tableNameToEscape)
SQLDatabaseType
languageEscapeTableName
in interface SQLDatabaseType
tableNameToEscape
- The non-null table namepublic String languageLimitQuery(String queryToLimit, String limit, String offset)
SQLDatabaseType
languageLimitQuery
in interface SQLDatabaseType
queryToLimit
- The sql query that will be amendedlimit
- The max number of the results to returnoffset
- The initial offset of the results to return