public abstract class DatabaseHelper extends Object
Modifier and Type | Field and Description |
---|---|
static DatabaseHelper |
DATABASE |
static String |
DATABASE_PROPERTY |
String |
databaseName |
static String |
DB_CLASS_NAME_BASE |
static String |
DB_DEFAULT |
static String |
DB_PROPERTY |
static String |
DEF_ID_TYPE |
static String |
DEFAULT_DATABASE_NAME |
static String |
DEFAULT_REPOSITORY_NAME |
static String |
DRIVER_PROPERTY |
static String |
ID_TYPE_PROPERTY |
static String |
PASSWORD_PROPERTY |
static String |
PORT_PROPERTY |
static String |
REPOSITORY_PROPERTY |
String |
repositoryName |
static String |
SERVER_PROPERTY |
static String |
SINGLEDS_PROPERTY |
static String |
URL_PROPERTY |
static String |
USER_PROPERTY |
static String |
XA_DATASOURCE_PROPERTY |
Constructor and Description |
---|
DatabaseHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
doOnAllTables(Connection connection,
String catalog,
String schemaPattern,
String statement)
Executes one statement on all the tables in a database.
|
static Connection |
getConnection(String url,
String user,
String password)
Gets a database connection, retrying if the server says it's overloaded.
|
abstract String |
getDeploymentContrib() |
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 |
setBinaryManager(Class<? extends BinaryManager> binaryManagerClass,
String key) |
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) |
static void |
setRepositoryFactory(Class<? extends RepositoryFactory> factoryClass) |
void |
setRepositoryName(String name) |
static void |
setSingleDataSourceMode() |
static String |
setSystemProperty(String name,
String def) |
void |
setUp() |
void |
setUp(Class<? extends RepositoryFactory> factoryClass) |
void |
sleepForFulltext()
For databases that do asynchronous fulltext indexing, sleep a bit.
|
boolean |
supportsArrayColumns() |
boolean |
supportsClustering()
For databases that don't support clustering.
|
boolean |
supportsMultipleFulltextIndexes() |
boolean |
supportsSequenceId()
Whether this database supports "sequence" as an id type.
|
boolean |
supportsSoftDelete() |
boolean |
supportsXA() |
void |
tearDown() |
public static final String DB_PROPERTY
public static final String DB_DEFAULT
public static final String DEF_ID_TYPE
public static DatabaseHelper DATABASE
public static final String DB_CLASS_NAME_BASE
public static final String REPOSITORY_PROPERTY
public static final String DRIVER_PROPERTY
public static final String XA_DATASOURCE_PROPERTY
public static final String URL_PROPERTY
public static final String SERVER_PROPERTY
public static final String PORT_PROPERTY
public static final String DATABASE_PROPERTY
public static final String USER_PROPERTY
public static final String PASSWORD_PROPERTY
public static final String ID_TYPE_PROPERTY
public static final String SINGLEDS_PROPERTY
public static final String DEFAULT_DATABASE_NAME
public String databaseName
public static final String DEFAULT_REPOSITORY_NAME
public String repositoryName
public void setDatabaseName(String name)
public void setRepositoryName(String name)
public static void setDatabaseForTests(String className)
public static Connection getConnection(String url, String user, String password) throws SQLException
SQLException
public static void doOnAllTables(Connection connection, String catalog, String schemaPattern, String statement) throws SQLException
SQLException
public void setUp(Class<? extends RepositoryFactory> factoryClass) throws Exception
Exception
public void tearDown() throws SQLException
SQLException
public static void setRepositoryFactory(Class<? extends RepositoryFactory> factoryClass)
public static void setBinaryManager(Class<? extends BinaryManager> binaryManagerClass, String key)
public abstract String getDeploymentContrib()
public abstract RepositoryDescriptor getRepositoryDescriptor()
public static void setSingleDataSourceMode()
public void sleepForFulltext()
public void maybeSleepToNextSecond()
public boolean hasSubSecondResolution()
public int getRecursiveRemovalDepthLimit()
public boolean supportsClustering()
public boolean supportsMultipleFulltextIndexes()
public boolean supportsXA()
public boolean supportsSoftDelete()
public boolean supportsSequenceId()
public boolean supportsArrayColumns()
Copyright © 2015 Nuxeo SA. All rights reserved.