Search in sources :

Example 1 with Oracle9Dialect

use of org.alfresco.repo.domain.dialect.Oracle9Dialect in project alfresco-repository by Alfresco.

the class NameValidatorTest method setUp.

@Before
public void setUp() throws Exception {
    validator = new NameValidator();
    validationResults = new Results();
    ctx = new DiffContext(new Oracle9Dialect(), validationResults, null, null);
}
Also used : DiffContext(org.alfresco.util.schemacomp.DiffContext) Results(org.alfresco.util.schemacomp.Results) Oracle9Dialect(org.alfresco.repo.domain.dialect.Oracle9Dialect) Before(org.junit.Before)

Example 2 with Oracle9Dialect

use of org.alfresco.repo.domain.dialect.Oracle9Dialect in project alfresco-repository by Alfresco.

the class SchemaBootstrap method checkDialect.

/**
 * Performs dialect-specific checking.  This includes checking for InnoDB, dumping the dialect being used
 * as well as setting any runtime, dialect-specific properties.
 */
private void checkDialect(Dialect dialect) {
    Class<?> dialectClazz = dialect.getClass();
    LogUtil.info(logger, MSG_DIALECT_USED, dialectClazz.getName());
    // if (dialectClazz.equals(MySQLDialect.class) || dialectClazz.equals(MySQL5Dialect.class))
    // {
    // LogUtil.error(logger, ERR_DIALECT_SHOULD_USE, dialectClazz.getName(), MySQLInnoDBDialect.class.getName());
    // throw AlfrescoRuntimeException.create(WARN_DIALECT_UNSUPPORTED, dialectClazz.getName());
    // }
    // else if (dialectClazz.equals(HSQLDialect.class))
    // {
    // LogUtil.info(logger, WARN_DIALECT_HSQL);
    // }
    // else if (dialectClazz.equals(DerbyDialect.class))
    // {
    // LogUtil.info(logger, WARN_DIALECT_DERBY);
    // }
    // else if (dialectClazz.equals(Oracle9iDialect.class) || dialectClazz.equals(Oracle10gDialect.class))
    // {
    // LogUtil.error(logger, ERR_DIALECT_SHOULD_USE, dialectClazz.getName(), Oracle9Dialect.class.getName());
    // throw AlfrescoRuntimeException.create(WARN_DIALECT_UNSUPPORTED, dialectClazz.getName());
    // }
    // else if (dialectClazz.equals(OracleDialect.class) || dialectClazz.equals(Oracle9Dialect.class))
    // {
    // LogUtil.error(logger, ERR_DIALECT_SHOULD_USE, dialectClazz.getName(), Oracle9Dialect.class.getName());
    // throw AlfrescoRuntimeException.create(WARN_DIALECT_UNSUPPORTED, dialectClazz.getName());
    // }
    int maxStringLength = SchemaBootstrap.DEFAULT_MAX_STRING_LENGTH;
    int serializableType = SerializableTypeHandler.getSerializableType();
    // Adjust the maximum allowable String length according to the dialect
    if (dialect instanceof SQLServerDialect) {
        // string_value nvarchar(1024) null,
        // serializable_value image null,
        maxStringLength = SchemaBootstrap.DEFAULT_MAX_STRING_LENGTH;
    } else if (dialect instanceof MySQLClusterNDBDialect) {
        // string_value varchar(400),
        // serializable_value blob,
        maxStringLength = SchemaBootstrap.DEFAULT_MAX_STRING_LENGTH_NDB;
    } else if (dialect instanceof MySQLInnoDBDialect) {
        // string_value text,
        // serializable_value blob,
        maxStringLength = Integer.MAX_VALUE;
    } else if (dialect instanceof Oracle9Dialect) {
        // string_value varchar2(1024 char),
        // serializable_value blob,
        maxStringLength = SchemaBootstrap.DEFAULT_MAX_STRING_LENGTH;
    } else if (dialect instanceof PostgreSQLDialect) {
        // string_value varchar(1024),
        // serializable_value bytea,
        maxStringLength = SchemaBootstrap.DEFAULT_MAX_STRING_LENGTH;
    }
    SchemaBootstrap.setMaxStringLength(maxStringLength, dialect);
    SerializableTypeHandler.setSerializableType(serializableType);
    // Now override the maximum string length if it was set directly
    if (maximumStringLength > 0) {
        SchemaBootstrap.setMaxStringLength(maximumStringLength, dialect);
    }
}
Also used : MySQLInnoDBDialect(org.alfresco.repo.domain.dialect.MySQLInnoDBDialect) PostgreSQLDialect(org.alfresco.repo.domain.dialect.PostgreSQLDialect) SQLServerDialect(org.alfresco.repo.domain.dialect.SQLServerDialect) MySQLClusterNDBDialect(org.alfresco.repo.domain.dialect.MySQLClusterNDBDialect) Oracle9Dialect(org.alfresco.repo.domain.dialect.Oracle9Dialect) Savepoint(java.sql.Savepoint)

Example 3 with Oracle9Dialect

use of org.alfresco.repo.domain.dialect.Oracle9Dialect in project alfresco-repository by Alfresco.

the class IndexColumnsValidatorTest method setUp.

@Before
public void setUp() throws Exception {
    validator = new IndexColumnsValidator();
    validationResults = new Results();
    ctx = new DiffContext(new Oracle9Dialect(), validationResults, null, null);
}
Also used : DiffContext(org.alfresco.util.schemacomp.DiffContext) Results(org.alfresco.util.schemacomp.Results) Oracle9Dialect(org.alfresco.repo.domain.dialect.Oracle9Dialect) Before(org.junit.Before)

Aggregations

Oracle9Dialect (org.alfresco.repo.domain.dialect.Oracle9Dialect)3 DiffContext (org.alfresco.util.schemacomp.DiffContext)2 Results (org.alfresco.util.schemacomp.Results)2 Before (org.junit.Before)2 Savepoint (java.sql.Savepoint)1 MySQLClusterNDBDialect (org.alfresco.repo.domain.dialect.MySQLClusterNDBDialect)1 MySQLInnoDBDialect (org.alfresco.repo.domain.dialect.MySQLInnoDBDialect)1 PostgreSQLDialect (org.alfresco.repo.domain.dialect.PostgreSQLDialect)1 SQLServerDialect (org.alfresco.repo.domain.dialect.SQLServerDialect)1