Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.storage.sql
Class DatabaseHelper

java.lang.Object
  extended by org.nuxeo.ecm.core.storage.sql.DatabaseHelper
Direct Known Subclasses:
DatabaseDerby, DatabaseH2, DatabaseMySQL, DatabaseOracle, DatabasePostgreSQL, DatabaseSQLServer

public abstract class DatabaseHelper
extends Object


Field Summary
static DatabaseHelper DATABASE
           
static String DATABASE_PROPERTY
           
static String DB_CLASS_NAME_BASE
           
static String DB_DEFAULT
           
static String DB_PROPERTY
           
static String DRIVER_PROPERTY
           
static String PASSWORD_PROPERTY
           
static String PORT_PROPERTY
           
static String REPOSITORY_PROPERTY
           
static String SERVER_PROPERTY
           
static String URL_PROPERTY
           
static String USER_PROPERTY
           
 
Constructor Summary
DatabaseHelper()
           
 
Method Summary
static void doOnAllTables(Connection connection, String catalog, String schemaPattern, String statement)
          Executes one statement on all the tables in a database.
abstract  String getDeploymentContrib()
           
 String getPooledDeploymentContrib()
           
 int getRecursiveRemovalDepthLimit()
          For databases that fail to cascade deletes beyond a certain depth.
abstract  RepositoryDescriptor getRepositoryDescriptor()
           
 boolean hasSubSecondResolution()
          For databases that don't have subsecond resolution, like MySQL.
 void maybeSleepToNextSecond()
          For databases that don't have subsecond resolution, sleep a bit to get to the next second.
static void setDatabaseForTests(String className)
          Sets the database backend used for VCS unit tests.
 void setDatabaseName(String name)
           
static String setProperty(String name, String def)
           
 void setRepositoryName(String name)
           
abstract  void setUp()
           
 void sleepForFulltext()
          For databases that do asynchronous fulltext indexing, sleep a bit.
 boolean supportsClustering()
          For databases that don't support clustering.
 boolean supportsMultipleFulltextIndexes()
           
 void tearDown()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DB_PROPERTY

public static final String DB_PROPERTY
See Also:
Constant Field Values

DB_DEFAULT

public static final String DB_DEFAULT
See Also:
Constant Field Values

DATABASE

public static DatabaseHelper DATABASE

DB_CLASS_NAME_BASE

public static final String DB_CLASS_NAME_BASE
See Also:
Constant Field Values

REPOSITORY_PROPERTY

public static final String REPOSITORY_PROPERTY
See Also:
Constant Field Values

DRIVER_PROPERTY

public static final String DRIVER_PROPERTY
See Also:
Constant Field Values

URL_PROPERTY

public static final String URL_PROPERTY
See Also:
Constant Field Values

SERVER_PROPERTY

public static final String SERVER_PROPERTY
See Also:
Constant Field Values

PORT_PROPERTY

public static final String PORT_PROPERTY
See Also:
Constant Field Values

DATABASE_PROPERTY

public static final String DATABASE_PROPERTY
See Also:
Constant Field Values

USER_PROPERTY

public static final String USER_PROPERTY
See Also:
Constant Field Values

PASSWORD_PROPERTY

public static final String PASSWORD_PROPERTY
See Also:
Constant Field Values
Constructor Detail

DatabaseHelper

public DatabaseHelper()
Method Detail

setProperty

public static String setProperty(String name,
                                 String def)

setDatabaseName

public void setDatabaseName(String name)

setRepositoryName

public void setRepositoryName(String name)

setDatabaseForTests

public static void setDatabaseForTests(String className)
Sets the database backend used for VCS unit tests.


doOnAllTables

public static void doOnAllTables(Connection connection,
                                 String catalog,
                                 String schemaPattern,
                                 String statement)
                          throws SQLException
Executes one statement on all the tables in a database.

Throws:
SQLException

setUp

public abstract void setUp()
                    throws Exception
Throws:
Exception

tearDown

public void tearDown()
              throws SQLException
Throws:
SQLException

getDeploymentContrib

public abstract String getDeploymentContrib()

getRepositoryDescriptor

public abstract RepositoryDescriptor getRepositoryDescriptor()

sleepForFulltext

public void sleepForFulltext()
For databases that do asynchronous fulltext indexing, sleep a bit.


maybeSleepToNextSecond

public void maybeSleepToNextSecond()
For databases that don't have subsecond resolution, sleep a bit to get to the next second.


hasSubSecondResolution

public boolean hasSubSecondResolution()
For databases that don't have subsecond resolution, like MySQL.


getRecursiveRemovalDepthLimit

public int getRecursiveRemovalDepthLimit()
For databases that fail to cascade deletes beyond a certain depth.


supportsClustering

public boolean supportsClustering()
For databases that don't support clustering.


supportsMultipleFulltextIndexes

public boolean supportsMultipleFulltextIndexes()

getPooledDeploymentContrib

public String getPooledDeploymentContrib()

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.