abstract class AbstractDialect implements Dialect {
private final String id;
private final String activeRecordDialectCode;
- private final String activeRecordJdbcAdapter;
private final String defaultDriverClassName;
private final String trueSqlValue;
private final String falseSqlValue;
private final String validationQuery;
- protected AbstractDialect(String id, String activeRecordDialectCode, String activeRecordJdbcAdapter, String defaultDriverClassName, String trueSqlValue, String falseSqlValue,
+ protected AbstractDialect(String id, String activeRecordDialectCode, String defaultDriverClassName, String trueSqlValue, String falseSqlValue,
String validationQuery) {
this.id = id;
this.activeRecordDialectCode = activeRecordDialectCode;
- this.activeRecordJdbcAdapter = activeRecordJdbcAdapter;
this.defaultDriverClassName = defaultDriverClassName;
this.trueSqlValue = trueSqlValue;
this.falseSqlValue = falseSqlValue;
return activeRecordDialectCode;
}
- public String getActiveRecordJdbcAdapter() {
- return activeRecordJdbcAdapter;
- }
-
public String getDefaultDriverClassName() {
return defaultDriverClassName;
}
*/
String getActiveRecordDialectCode();
- /**
- * @return the activerecord-jdbc adapter. See the property 'adapter' in database.yml
- */
- String getActiveRecordJdbcAdapter();
-
/**
* Used to autodetect a dialect for a given driver URL
*
public static final String ID = "h2";
public H2() {
- super(ID, "h2", "jdbc", "org.h2.Driver", "true", "false", "SELECT 1");
+ super(ID, "h2", "org.h2.Driver", "true", "false", "SELECT 1");
}
public Class<? extends org.hibernate.dialect.Dialect> getHibernateDialectClass() {
public static final String ID = "mssql";
public MsSql() {
- super(ID, "sqlserver", "jdbc", "net.sourceforge.jtds.jdbc.Driver", "1", "0", "SELECT 1");
+ super(ID, "sqlserver", "net.sourceforge.jtds.jdbc.Driver", "1", "0", "SELECT 1");
}
public Class<? extends org.hibernate.dialect.Dialect> getHibernateDialectClass() {
public static final String ID = "mysql";
public MySql() {
- super(ID, "mysql", "jdbc", "com.mysql.jdbc.Driver", "true", "false", "SELECT 1");
+ super(ID, "mysql", "com.mysql.jdbc.Driver", "true", "false", "SELECT 1");
}
public Class<? extends org.hibernate.dialect.Dialect> getHibernateDialectClass() {
public static final String ID = "oracle";
public Oracle() {
- super(ID, "oracle", "jdbc", "oracle.jdbc.OracleDriver", "1", "0", "SELECT 1 FROM DUAL");
+ super(ID, "oracle", "oracle.jdbc.OracleDriver", "1", "0", "SELECT 1 FROM DUAL");
}
public Class<? extends org.hibernate.dialect.Dialect> getHibernateDialectClass() {
public static final String ID = "postgresql";
public PostgreSql() {
- super(ID, "postgre", "jdbc", "org.postgresql.Driver", "true", "false", "SELECT 1");
+ super(ID, "postgre", "org.postgresql.Driver", "true", "false", "SELECT 1");
}
public Class<? extends org.hibernate.dialect.Dialect> getHibernateDialectClass() {
public void should_configure() {
assertThat(h2.getId()).isEqualTo("h2");
assertThat(h2.getActiveRecordDialectCode()).isEqualTo("h2");
- assertThat(h2.getActiveRecordJdbcAdapter()).isEqualTo("jdbc");
assertThat(h2.getDefaultDriverClassName()).isEqualTo("org.h2.Driver");
assertThat(h2.getValidationQuery()).isEqualTo("SELECT 1");
}
public void should_configure() {
assertThat(msSql.getId()).isEqualTo("mssql");
assertThat(msSql.getActiveRecordDialectCode()).isEqualTo("sqlserver");
- assertThat(msSql.getActiveRecordJdbcAdapter()).isEqualTo("jdbc");
assertThat(msSql.getDefaultDriverClassName()).isEqualTo("net.sourceforge.jtds.jdbc.Driver");
assertThat(msSql.getValidationQuery()).isEqualTo("SELECT 1");
}
public void should_configure() {
assertThat(mySql.getId()).isEqualTo("mysql");
assertThat(mySql.getActiveRecordDialectCode()).isEqualTo("mysql");
- assertThat(mySql.getActiveRecordJdbcAdapter()).isEqualTo("jdbc");
assertThat(mySql.getDefaultDriverClassName()).isEqualTo("com.mysql.jdbc.Driver");
assertThat(mySql.getValidationQuery()).isEqualTo("SELECT 1");
}
public void should_configure() {
assertThat(oracle.getId()).isEqualTo("oracle");
assertThat(oracle.getActiveRecordDialectCode()).isEqualTo("oracle");
- assertThat(oracle.getActiveRecordJdbcAdapter()).isEqualTo("jdbc");
assertThat(oracle.getDefaultDriverClassName()).isEqualTo("oracle.jdbc.OracleDriver");
assertThat(oracle.getValidationQuery()).isEqualTo("SELECT 1 FROM DUAL");
}
public void should_configure() {
assertThat(postgreSql.getId()).isEqualTo("postgresql");
assertThat(postgreSql.getActiveRecordDialectCode()).isEqualTo("postgre");
- assertThat(postgreSql.getActiveRecordJdbcAdapter()).isEqualTo("jdbc");
assertThat(postgreSql.getDefaultDriverClassName()).isEqualTo("org.postgresql.Driver");
assertThat(postgreSql.getValidationQuery()).isEqualTo("SELECT 1");
}
base: &base
- adapter: <%= ::Java::OrgSonarServerUi::JRubyFacade.getInstance().getDatabase().getDialect().getActiveRecordJdbcAdapter() %>
+ adapter: jdbc
url: <%= ::Java::OrgSonarServerUi::JRubyFacade.getInstance().getConfigurationValue('sonar.jdbc.url') %>
dialect: <%= ::Java::OrgSonarServerUi::JRubyFacade.getInstance().getDatabase().getDialect().getActiveRecordDialectCode() %>
driver: <%= ::Java::OrgSonarServerUi::JRubyFacade.getInstance().getConfigurationValue('sonar.jdbc.driverClassName') %>