public class HSQLRepository extends JDBCRepository
JDBC.QueryExecutor, JDBC.TemplateRepository.ConfigurationNode| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
DATABASE_DIR_NAME |
protected java.lang.String |
dbDirPath |
protected HSQLDB |
hsqldb |
FIELD_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 |
|---|
HSQLRepository() |
| 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.
|
RepositoryConnection |
getConnection()
Gets a connection for manipulating repository's content.
|
java.lang.String |
getDatabaseDirectoryName() |
protected java.lang.String |
getEntriesWithLimitQuery(long offset,
long number)
Implementation of statement with a limit parameter
HSQL implementation
SELECT LIMIT >offset< >number<
DISTINCT * FROM >table_name<);
|
protected java.lang.String |
getOptimizeQuery() |
protected java.lang.String |
getTableCreationQuery()
Returns an SQL query that could create the table.
|
protected java.lang.String |
getTableName()
Returns a table name used to store the repository's data.
|
void |
init()
Initializes the repository.
|
protected boolean |
initToSax()
Init the LinkedHashMap _xmlizable_objects with the objects in order to describ them in XML
|
void |
optimize()
Utility method for repository maintenance,
normally used to optimize indices of Lucene based repositories
It is the responsibility of the Repository to ensure that
unnecessary optimizations are not performed when this method
is called.
|
void |
releaseConnection(RepositoryConnection conn)
Releases a previously opened connection.
|
void |
restore(SaveParameters save_config)
Restore the repository
|
add, delete, empty, get, getDeleteAllQuery, getDocumentAddQuery, getDocumentDeleteQuery, initVolatileObjectsToSax, lists, openStream, size, toSAXcheckConnection, checkEncoding, exists, getClassNameSuffix, getDocumentGetQuery, isDefault, loadBaseConfiguration, setIsDefaultfinalize, getDataSourceComponent, releaseDataSourceComponent, servicecreateTable, 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 dbDirPath
protected HSQLDB hsqldb
protected java.lang.String DATABASE_DIR_NAME
public java.lang.String getDatabaseDirectoryName()
public 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.ConfigurationExceptionprotected java.lang.String getTableCreationQuery()
This query should not have any parameter.
getTableCreationQuery in class JDBCRepositoryprotected java.lang.String getEntriesWithLimitQuery(long offset,
long number)
getEntriesWithLimitQuery in class JDBCRepositorypublic void init()
throws SDXException
init in interface Repositoryinit in class JDBCRepositorySDXExceptionprotected java.lang.String getTableName()
JDBCgetTableName in class JDBCpublic RepositoryConnection getConnection() throws SDXException
getConnection in interface RepositorygetConnection in class JDBCRepositorySDXExceptionpublic void releaseConnection(RepositoryConnection conn) throws SDXException
JDBCRepositoryreleaseConnection in interface RepositoryreleaseConnection in class JDBCRepositoryconn - A connection.SDXExceptionpublic void optimize()
throws SDXException
Repositoryoptimize in interface Repositoryoptimize in class AbstractDataSourceComponentBackedRepositorySDXExceptionprotected java.lang.String getOptimizeQuery()
protected boolean initToSax()
AbstractSdxObjectinitToSax in class JDBCRepositorypublic void backup(SaveParameters save_config) throws SDXException
backup in interface Saveablebackup in class JDBCRepositorySDXExceptionSaveable.backup(fr.gouv.culture.sdx.utils.save.SaveParameters)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.