public class HSQLDatabase extends AbstractJDBCDatabase
JDBC.QueryExecutor, JDBC.Template
SdxObject.ConfigurationNode
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
DATABASE_DIR_NAME |
protected java.lang.String |
dbDirPath |
protected HSQLDB |
hsqldb |
_searchModes, COLUMN_PARAM_INDEX_FIELD_ID, COLUMN_PARAM_INDEX_FIELD_PROPERTY_NAME, COLUMN_PARAM_INDEX_FIELD_PROPERTY_VALUE, FIELD_ID, FIELD_PROPERTY_NAME, FIELD_PROPERTY_VALUE
ATTRIBUTE_DSI, dbSelector, dsi
_configuration, _context, _description, _encoding, _id, _locale, _logger, _manager, _xmlizable_objects, _xmlLang, isToSaxInitialized
CLASS_NAME_SUFFIX, DATABASE_DIR_PATH, PACKAGE_QUALNAME, SEARCH_MODE_AND, SEARCH_MODE_NOT, SEARCH_MODE_OR
DEFAULT_ENCODING
ALL_SAVE_ATTRIB, PATH_ATTRIB, SAVE_DIRECTORY_PARAM
Constructor and Description |
---|
HSQLDatabase() |
Modifier and Type | Method and Description |
---|---|
void |
backup(SaveParameters save_config)
Save the database
|
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration) |
protected void |
finalize() |
protected java.lang.String |
getAlterTableNameQuery(java.lang.String oldName) |
DatabaseConnection |
getConnection() |
java.lang.String |
getDatabaseDirectoryName()
If the database is a directory based file system implemenation like lucene
this method should return a valid name for a directory which may be created to house
the database, or in the case of hsql it will return a valid table name
|
protected java.lang.String |
getEntriesWithLimitQuery(long offset,
long number)
Implementation of statement with a limit parameter
|
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 database.
|
protected boolean |
initToSax()
Init the LinkedHashMap _xmlizable_objects with the objects in order to describ them in XML
|
protected void |
initVolatileObjectsToSax()
Init the LinkedHashMap _xmlizable_volatile_objects with the objects in order to describ them in XML
Some objects need to be refresh each time a toSAX is called
|
void |
optimize()
Utility method for database 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(DatabaseConnection conn) |
void |
restore(SaveParameters save_config)
Restore the database
|
java.lang.String[] |
search(org.apache.avalon.framework.parameters.Parameters params,
int mode) |
addProperty, createIndicies, delete, delete, empty, entityExists, getAllEntitiesQuery, getClassNameSuffix, getCreateIndiciesQuery, getDeleteAllQuery, getEntities, getEntities, getEntity, getEntity, getEntityDeleteQuery, getEntityGetQuery, getEntityIds, getProperties, getPropertyAddQuery, getPropertyRemoveQueryWithId, getPropertyRemoveQueryWithoutId, getPropertyValue, getPropertyValues, getWildcardSearchToken, removeProperty, removeProperty, save, search, searchWithParams, size, update
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()
Database
public void configure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
configure
in interface org.apache.avalon.framework.configuration.Configurable
configure
in class AbstractJDBCDatabase
org.apache.avalon.framework.configuration.ConfigurationException
public DatabaseConnection getConnection() throws SDXException
getConnection
in interface Database
getConnection
in class AbstractJDBCDatabase
SDXException
public void releaseConnection(DatabaseConnection conn) throws SDXException
releaseConnection
in interface Database
releaseConnection
in class AbstractJDBCDatabase
SDXException
protected java.lang.String getOptimizeQuery()
public void optimize() throws SDXException
Database
SDXException
public void init() throws SDXException
init
in interface Database
init
in class AbstractJDBCDatabase
SDXException
protected java.lang.String getTableCreationQuery()
JDBC
This query should not have any parameter.
getTableCreationQuery
in class AbstractJDBCDatabase
protected java.lang.String getTableName()
JDBC
getTableName
in class JDBC
protected java.lang.String getAlterTableNameQuery(java.lang.String oldName)
protected void finalize() throws java.lang.Throwable
finalize
in class DataSourceComponentBacked
java.lang.Throwable
public java.lang.String[] search(org.apache.avalon.framework.parameters.Parameters params, int mode) throws SDXException
search
in interface Database
search
in class AbstractJDBCDatabase
SDXException
protected boolean initToSax()
AbstractSdxObject
initToSax
in class AbstractSdxObject
protected void initVolatileObjectsToSax()
initVolatileObjectsToSax
in class JDBC
public void backup(SaveParameters save_config) throws SDXException
backup
in interface Saveable
backup
in class AbstractJDBCDatabase
SDXException
Saveable.backup(fr.gouv.culture.sdx.utils.save.SaveParameters)
protected java.lang.String getEntriesWithLimitQuery(long offset, long number)
AbstractJDBCDatabase
getEntriesWithLimitQuery
in class AbstractJDBCDatabase
HSQL implementation
SELECT LIMIT >offset< >number<
DISTINCT * FROM >table_name<);
public void restore(SaveParameters save_config) throws SDXException
restore
in interface Saveable
restore
in class AbstractJDBCDatabase
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.