Package com.opengamma.util.db

Examples of com.opengamma.util.db.DbDialect


    DbConnector connector = s_connectors.get(key);
    if (connector == null) {
      synchronized (this) {
        connector = s_connectors.get(key);
        if (connector == null) {
          DbDialect dbDialect = DbDialectUtils.getSupportedDbDialect(getDatabaseType());
          DbConnectorFactoryBean factory = new DbConnectorFactoryBean();
          factory.setName("DbTest-" + dbDialect.getName() + (scope != null ? "-" + scope.getSimpleName() : ""));
          factory.setDialect(dbDialect);
          factory.setDataSource(getDbTool().getDataSource());
          factory.setTransactionIsolationLevelName("ISOLATION_READ_COMMITTED");
          factory.setTransactionPropagationBehaviorName("PROPAGATION_REQUIRED");
          initDbConnectorFactory(factory);
View Full Code Here


   *
   * @param databaseType  the database type, not null
   * @return the dialect, not null
   */
  public static DbDialect getSupportedDbDialect(String databaseType) {
    DbDialect dbDialect = getSupportedDbDialects().get(databaseType);
    if (dbDialect == null) {
      throw new OpenGammaRuntimeException("Config error - no DbDialect setup for " + databaseType);
    }
    return dbDialect;
  }
View Full Code Here

    Collection<String> databaseTypes = Sets.newHashSet(s_dbDialects.keySet());
    for (Iterator<String> it = databaseTypes.iterator(); it.hasNext(); ) {
      String dbType = it.next();
      Boolean available = s_availableDialects.get(dbType);
      if (available == null) {
        DbDialect dbDialect = s_dbDialects.get(dbType);
        try {
          Objects.requireNonNull(dbDialect.getJDBCDriverClass());
          available = true;
        } catch (RuntimeException | Error ex) {
          available = false;
          System.err.println("Database driver not available: " + dbType);
        }
View Full Code Here

   *
   * @param databaseType  the database type, not null
   * @return the dialect, not null
   */
  public static DbDialect getAvailableDbDialect(String databaseType) {
    DbDialect dbDialect = getAvailableDbDialects().get(databaseType);
    if (dbDialect == null) {
      throw new OpenGammaRuntimeException("Config error - no available DbDialect for " + databaseType);
    }
    return dbDialect;
  }
View Full Code Here

    }
    initDbConnector(repo);
  }
 
  protected DbConnector initDbConnector(ComponentRepository repo) {
    DbDialect dialect = createDialect();
    NamedParameterJdbcTemplate jdbcTemplate = new NamedParameterJdbcTemplate(getDataSource());
    SessionFactory hibernateSessionFactory = createHibernateSessionFactory(dialect);
    HibernateTemplate hibernateTemplate = createHibernateTemplate(hibernateSessionFactory);
    TransactionTemplate transactionTemplate = createTransactionTemplate(hibernateSessionFactory);
    DbConnector dbConnector = new DbConnector(getName(), dialect, getDataSource(), jdbcTemplate, hibernateTemplate, transactionTemplate);
View Full Code Here

TOP

Related Classes of com.opengamma.util.db.DbDialect

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.