public class HSQLRepository extends JDBCRepository
JDBC.QueryExecutor, JDBC.Template
Repository.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_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 |
---|
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, toSAX
checkConnection, checkEncoding, exists, getClassNameSuffix, getDocumentGetQuery, isDefault, loadBaseConfiguration, setIsDefault
finalize, getDataSourceComponent, releaseDataSourceComponent, service
createTable, 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 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
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
protected java.lang.String getTableCreationQuery()
This query should not have any parameter.
getTableCreationQuery
in class JDBCRepository
protected java.lang.String getEntriesWithLimitQuery(long offset, long number)
getEntriesWithLimitQuery
in class JDBCRepository
public void init() throws SDXException
init
in interface Repository
init
in class JDBCRepository
SDXException
protected java.lang.String getTableName()
JDBC
getTableName
in class JDBC
public RepositoryConnection getConnection() throws SDXException
getConnection
in interface Repository
getConnection
in class JDBCRepository
SDXException
public void releaseConnection(RepositoryConnection conn) throws SDXException
JDBCRepository
releaseConnection
in interface Repository
releaseConnection
in class JDBCRepository
conn
- A connection.SDXException
public void optimize() throws SDXException
Repository
optimize
in interface Repository
optimize
in class AbstractDataSourceComponentBackedRepository
SDXException
protected java.lang.String getOptimizeQuery()
protected boolean initToSax()
AbstractSdxObject
initToSax
in class JDBCRepository
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)
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.