Package org.nuxeo.ecm.core.storage.sql
Class DatabaseHelper
java.lang.Object
org.nuxeo.ecm.core.storage.sql.DatabaseHelper
- Direct Known Subclasses:
DatabaseDB2
,DatabaseH2
,DatabaseMySQL
,DatabaseOracle
,DatabasePostgreSQL
,DatabaseSQLServer
-
Field Summary
Modifier and TypeFieldDescriptionstatic DatabaseHelper
static final String
static final String
static final String
static final String
static final String
static final String
protected static final Class<? extends BlobProvider>
static final String
static final String
protected Error
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
doOnAllTables
(Connection connection, String catalog, String schemaPattern, String statement) Executes one statement on all the tables in a database.protected static void
executeSql
(Statement st, String sql) static Connection
getConnection
(String url, String user, String password) Gets a database connection, retrying if the server says it's overloaded.abstract String
int
For databases that fail to cascade deletes beyond a certain depth.abstract RepositoryDescriptor
static void
setBinaryManager
(Class<? extends BinaryManager> binaryManagerClass, String key) Deprecated.static void
setBlobProvider
(Class<? extends BlobProvider> blobProviderClass, String key) static void
setDatabaseForTests
(String className) Sets the database backend used for VCS unit tests.void
setDatabaseName
(String name) protected void
setOwner()
static String
setProperty
(String name, String def) static String
setSystemProperty
(String name, String def) void
setUp()
void
For databases that do asynchronous fulltext indexing, sleep a bit.boolean
boolean
For databases that don't support clustering.boolean
boolean
boolean
Whether this database supports "sequence" as an id type.boolean
boolean
void
tearDown()
-
Field Details
-
DB_PROPERTY
- See Also:
-
DB_DEFAULT
- See Also:
-
DEF_ID_TYPE
- See Also:
-
DATABASE
-
DB_CLASS_NAME_BASE
- See Also:
-
defaultBlobProvider
-
DRIVER_PROPERTY
- See Also:
-
URL_PROPERTY
- See Also:
-
SERVER_PROPERTY
- See Also:
-
PORT_PROPERTY
- See Also:
-
DATABASE_PROPERTY
- See Also:
-
USER_PROPERTY
- See Also:
-
PASSWORD_PROPERTY
- See Also:
-
ID_TYPE_PROPERTY
- See Also:
-
owner
-
DEFAULT_DATABASE_NAME
- See Also:
-
databaseName
-
-
Constructor Details
-
DatabaseHelper
public DatabaseHelper()
-
-
Method Details
-
setSystemProperty
-
setProperty
-
setDatabaseName
-
setDatabaseForTests
Sets the database backend used for VCS unit tests. -
getConnection
public static Connection getConnection(String url, String user, String password) throws SQLException Gets a database connection, retrying if the server says it's overloaded.- Throws:
SQLException
- Since:
- 5.9.3
-
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
-
executeSql
- Throws:
SQLException
-
setUp
- Throws:
SQLException
-
setOwner
protected void setOwner() -
tearDown
- Throws:
SQLException
-
setBlobProvider
- Since:
- 2023.9
-
setBinaryManager
@Deprecated(since="2023.9") public static void setBinaryManager(Class<? extends BinaryManager> binaryManagerClass, String key) Deprecated.since 2023.9, usesetBlobProvider(Class, String)
instead -
getDeploymentContrib
-
getRepositoryDescriptor
-
sleepForFulltext
public void sleepForFulltext()For databases that do asynchronous fulltext indexing, sleep a bit. -
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() -
supportsFulltextSearch
public boolean supportsFulltextSearch()- Since:
- 11.1
-
supportsXA
public boolean supportsXA() -
supportsSoftDelete
public boolean supportsSoftDelete() -
supportsSequenceId
public boolean supportsSequenceId()Whether this database supports "sequence" as an id type.- Since:
- 5.9.3
-
supportsArrayColumns
public boolean supportsArrayColumns()
-
setBlobProvider(Class, String)
instead