public class MYSQLRepository extends JDBCRepository
JDBC.QueryExecutor, JDBC.Template
Repository.ConfigurationNode
FIELD_DATA, NO_SPECIFIC_TYPE, PARAM_INDEX_FIELD_DATA_ORIGINAL
FIELD_ID, isDefault, PARAM_INDEX_FIELD_ID
ATTRIBUTE_DSI, dbSelector, dsi
_configuration, _context, _description, _encoding, _id, _locale, _logger, _manager, _xmlizable_objects, _xmlLang, isToSaxInitialized
CLASS_NAME_SUFFIX, PACKAGE_QUALNAME
DEFAULT_ENCODING
ALL_SAVE_ATTRIB, PATH_ATTRIB, SAVE_DIRECTORY_PARAM
Constructor and Description |
---|
MYSQLRepository() |
Modifier and Type | Method and Description |
---|---|
void |
backup(SaveParameters save_config)
Save the repository
|
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
Configures this repository.
|
protected java.lang.String |
getEntriesWithLimitQuery(long offset,
long number)
Implementation of statement with a limit parameter
No limit there, implementation is done in the subclasses.
|
protected java.lang.String |
getTableCreationQuery()
Returns an SQL query that could create the table.
|
void |
restore(SaveParameters save_config)
Restore the repository
|
add, delete, empty, get, getConnection, getDeleteAllQuery, getDocumentAddQuery, getDocumentDeleteQuery, init, initToSax, initVolatileObjectsToSax, lists, openStream, releaseConnection, size, toSAX
checkConnection, checkEncoding, exists, getClassNameSuffix, getDocumentGetQuery, isDefault, loadBaseConfiguration, optimize, setIsDefault
finalize, getDataSourceComponent, releaseDataSourceComponent, service
createTable, getTableName, handleUnsupportedTokens
configureDescription, contextualize, enableLogging, getBaseAttributes, getConfiguration, getContext, getDescription, getEncoding, getId, getLocale, getLog, getServiceManager, getXmlLang, setDescription, setEncoding, setId, setLocale, setUpSdxObject, setUpSdxObject, setXmlLang, toSAX, verifyConfigurationResources
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getId, setId
getDescription, setDescription
getEncoding, setEncoding
getLocale, getXmlLang, setLocale, setXmlLang
protected java.lang.String getTableCreationQuery()
This query should not have any parameter.
getTableCreationQuery
in class JDBCRepository
public void configure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
JDBCRepository
In addition to the parameters needed in the base configuration handled by the parent class, the following parameter is required: data source _identifier (dsi), the value of the "name" attribute of the "jdbc" subElement for the "datasources" element in cocoon.xconf (user must create this information in cocoon.xconf)
configure
in interface org.apache.avalon.framework.configuration.Configurable
configure
in class JDBCRepository
configuration
- The configuration for this repository (based on a xml file).
Sample configuration entry:
<sdx:repository sdx:type = "JDBC" sdx:id = "myRepoId" dsi = "datasource _identifier from cocoon.xconf"/>
org.apache.avalon.framework.configuration.ConfigurationException
public void backup(SaveParameters save_config) throws SDXException
backup
in interface Saveable
backup
in class JDBCRepository
SDXException
Saveable.backup(fr.gouv.culture.sdx.utils.save.SaveParameters)
protected java.lang.String getEntriesWithLimitQuery(long offset, long number)
JDBCRepository
getEntriesWithLimitQuery
in class JDBCRepository
MYSQL implementation
SELECT * FROM >table_name< LIMIT >offset<,>number< ;
public void restore(SaveParameters save_config) throws SDXException
restore
in interface Saveable
restore
in class JDBCRepository
SDXException
Saveable.restore(fr.gouv.culture.sdx.utils.save.SaveParameters)
Copyright © 2000-2010 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.