public class MYSQLRepository extends JDBCRepository
JDBC.QueryExecutor, JDBC.TemplateRepository.ConfigurationNodeFIELD_DATA, NO_SPECIFIC_TYPE, PARAM_INDEX_FIELD_DATA_ORIGINALFIELD_ID, isDefault, PARAM_INDEX_FIELD_IDATTRIBUTE_DSI, dbSelector, dsi_configuration, _context, _description, _encoding, _id, _locale, _logger, _manager, _xmlizable_objects, _xmlLang, isToSaxInitializedCLASS_NAME_SUFFIX, PACKAGE_QUALNAMEDEFAULT_ENCODINGALL_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, toSAXcheckConnection, checkEncoding, exists, getClassNameSuffix, getDocumentGetQuery, isDefault, loadBaseConfiguration, optimize, setIsDefaultfinalize, getDataSourceComponent, releaseDataSourceComponent, servicecreateTable, getTableName, handleUnsupportedTokensconfigureDescription, contextualize, enableLogging, getBaseAttributes, getConfiguration, getContext, getDescription, getEncoding, getId, getLocale, getLog, getServiceManager, getXmlLang, setDescription, setEncoding, setId, setLocale, setUpSdxObject, setUpSdxObject, setXmlLang, toSAX, verifyConfigurationResourcesclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetId, setIdgetDescription, setDescriptiongetEncoding, setEncodinggetLocale, getXmlLang, setLocale, setXmlLangprotected java.lang.String getTableCreationQuery()
This query should not have any parameter.
getTableCreationQuery in class JDBCRepositorypublic void configure(org.apache.avalon.framework.configuration.Configuration configuration)
throws org.apache.avalon.framework.configuration.ConfigurationException
JDBCRepositoryIn 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.Configurableconfigure in class JDBCRepositoryconfiguration - 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.ConfigurationExceptionpublic void backup(SaveParameters save_config) throws SDXException
backup in interface Saveablebackup in class JDBCRepositorySDXExceptionSaveable.backup(fr.gouv.culture.sdx.utils.save.SaveParameters)protected java.lang.String getEntriesWithLimitQuery(long offset,
long number)
JDBCRepositorygetEntriesWithLimitQuery in class JDBCRepositoryMYSQL implementation
SELECT * FROM >table_name< LIMIT >offset<,>number< ;public void restore(SaveParameters save_config) throws SDXException
restore in interface Saveablerestore in class JDBCRepositorySDXExceptionSaveable.restore(fr.gouv.culture.sdx.utils.save.SaveParameters)Copyright © 2000-2010 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.