Class DatabaseHelper

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

public abstract class DatabaseHelper extends Object
  • Field Details

  • Constructor Details

    • DatabaseHelper

      public DatabaseHelper()
  • Method Details

    • setSystemProperty

      public static String setSystemProperty(String name, String def)
    • setProperty

      public static String setProperty(String name, String def)
    • setDatabaseName

      public void setDatabaseName(String name)
    • setDatabaseForTests

      public static void setDatabaseForTests(String className)
      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

      protected static void executeSql(Statement st, String sql) throws SQLException
      Throws:
      SQLException
    • setUp

      public void setUp() throws SQLException
      Throws:
      SQLException
    • setOwner

      protected void setOwner()
    • tearDown

      public void tearDown() throws SQLException
      Throws:
      SQLException
    • setBlobProvider

      public static void setBlobProvider(Class<? extends BlobProvider> blobProviderClass, String key)
      Since:
      2023.9
    • setBinaryManager

      @Deprecated(since="2023.9") public static void setBinaryManager(Class<? extends BinaryManager> binaryManagerClass, String key)
      Deprecated.
      since 2023.9, use setBlobProvider(Class, String) instead
    • getDeploymentContrib

      public abstract String getDeploymentContrib()
    • getRepositoryDescriptor

      public abstract RepositoryDescriptor 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()