congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Dialect.getTrueSqlValue
Code IndexAdd Tabnine to your IDE (free)

How to use
getTrueSqlValue
method
in
org.sonar.db.dialect.Dialect

Best Java code snippets using org.sonar.db.dialect.Dialect.getTrueSqlValue (Showing top 6 results out of 315)

origin: SonarSource/sonarqube

private void appendDefaultValue(StringBuilder sql, ColumnDef columnDef) {
 Object defaultValue = columnDef.getDefaultValue();
 if (defaultValue != null) {
  sql.append(" DEFAULT ");
  if (defaultValue instanceof String) {
   sql.append(format("'%s'", defaultValue));
  } else if (defaultValue instanceof Boolean) {
   sql.append((boolean) defaultValue ? dialect.getTrueSqlValue() : dialect.getFalseSqlValue());
  } else {
   sql.append(defaultValue);
  }
 }
}
origin: SonarSource/sonarqube

private void addColumn(StringBuilder sql, ColumnDef columnDef) {
 sql.append(columnDef.getName()).append(" ").append(columnDef.generateSqlType(dialect));
 Object defaultValue = columnDef.getDefaultValue();
 if (defaultValue != null) {
  sql.append(" DEFAULT ");
  // TODO remove duplication with CreateTableBuilder
  if (defaultValue instanceof String) {
   sql.append(format("'%s'", defaultValue));
  } else if (defaultValue instanceof Boolean) {
   sql.append((boolean) defaultValue ? dialect.getTrueSqlValue() : dialect.getFalseSqlValue());
  } else {
   sql.append(defaultValue);
  }
 }
 sql.append(columnDef.isNullable() ? " NULL" : " NOT NULL");
}
origin: SonarSource/sonarqube

MyBatisConfBuilder(Database database) {
 this.conf = new Configuration();
 this.conf.setEnvironment(new Environment("production", createTransactionFactory(), database.getDataSource()));
 this.conf.setUseGeneratedKeys(true);
 this.conf.setLazyLoadingEnabled(false);
 this.conf.setJdbcTypeForNull(JdbcType.NULL);
 Dialect dialect = database.getDialect();
 this.conf.setDatabaseId(dialect.getId());
 this.conf.getVariables().setProperty("_true", dialect.getTrueSqlValue());
 this.conf.getVariables().setProperty("_false", dialect.getFalseSqlValue());
 this.conf.getVariables().setProperty("_from_dual", dialect.getSqlFromDual());
 this.conf.getVariables().setProperty("_scrollFetchSize", String.valueOf(dialect.getScrollDefaultFetchSize()));
 this.conf.setLocalCacheScope(LocalCacheScope.STATEMENT);
}
origin: org.sonarsource.sonarqube/sonar-db-migration

private void appendDefaultValue(StringBuilder sql, ColumnDef columnDef) {
 Object defaultValue = columnDef.getDefaultValue();
 if (defaultValue != null) {
  sql.append(" DEFAULT ");
  if (defaultValue instanceof String) {
   sql.append(format("'%s'", defaultValue));
  } else if (defaultValue instanceof Boolean) {
   sql.append((boolean) defaultValue ? dialect.getTrueSqlValue() : dialect.getFalseSqlValue());
  } else {
   sql.append(defaultValue);
  }
 }
}
origin: org.sonarsource.sonarqube/sonar-db-migration

private void addColumn(StringBuilder sql, ColumnDef columnDef) {
 sql.append(columnDef.getName()).append(" ").append(columnDef.generateSqlType(dialect));
 Object defaultValue = columnDef.getDefaultValue();
 if (defaultValue != null) {
  sql.append(" DEFAULT ");
  // TODO remove duplication with CreateTableBuilder
  if (defaultValue instanceof String) {
   sql.append(format("'%s'", defaultValue));
  } else if (defaultValue instanceof Boolean) {
   sql.append((boolean) defaultValue ? dialect.getTrueSqlValue() : dialect.getFalseSqlValue());
  } else {
   sql.append(defaultValue);
  }
 }
 sql.append(columnDef.isNullable() ? " NULL" : " NOT NULL");
}
origin: org.sonarsource.sonarqube/sonar-db

public MyBatisConfBuilder(Database database) {
 this.conf = new Configuration();
 this.conf.setEnvironment(new Environment("production", createTransactionFactory(), database.getDataSource()));
 this.conf.setUseGeneratedKeys(true);
 this.conf.setLazyLoadingEnabled(false);
 this.conf.setJdbcTypeForNull(JdbcType.NULL);
 Dialect dialect = database.getDialect();
 this.conf.setDatabaseId(dialect.getId());
 this.conf.getVariables().setProperty("_true", dialect.getTrueSqlValue());
 this.conf.getVariables().setProperty("_false", dialect.getFalseSqlValue());
 this.conf.getVariables().setProperty("_scrollFetchSize", String.valueOf(dialect.getScrollDefaultFetchSize()));
 this.conf.setLocalCacheScope(LocalCacheScope.STATEMENT);
}
org.sonar.db.dialectDialectgetTrueSqlValue

Popular methods of Dialect

  • getId
  • getFalseSqlValue
  • getScrollDefaultFetchSize
    Fetch size to be used when scrolling large result sets.
  • getConnectionInitStatements
  • getDefaultDriverClassName
  • getValidationQuery
    Query used to validate the jdbc connection.
  • supportsMigration
    Indicates whether DB migration can be perform on the DB vendor implementation associated with the cu
  • getScrollSingleRowFetchSize
    Fetch size to scroll one row at a time. It sounds strange because obviously value is 1 in most cases
  • init
    This method is called when connecting for the first time to the database.
  • matchesJdbcUrl
    Used to autodetect dialect from connection URL
  • supportsUpsert
  • getSqlFromDual
  • supportsUpsert,
  • getSqlFromDual,
  • matchesJdbcURL

Popular in Java

  • Reactive rest calls using spring rest template
  • addToBackStack (FragmentTransaction)
  • findViewById (Activity)
  • startActivity (Activity)
  • Kernel (java.awt.image)
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Reference (javax.naming)
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now