Java Code Examples for org.jooq.SQLDialect

The following examples show how to use org.jooq.SQLDialect. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: hellokoding-courses   Source File: Application.java    License: MIT License 6 votes vote down vote up
public static void main(String[] args) throws Exception {
    String user = System.getProperty("jdbc.user");
    String password = System.getProperty("jdbc.password");
    String url = System.getProperty("jdbc.url");
    String driver = System.getProperty("jdbc.driver");

    Class.forName(driver).newInstance();
    try (Connection connection = DriverManager.getConnection(url, user, password)) {
        DSLContext dslContext = DSL.using(connection, SQLDialect.MYSQL);
        Result<Record> result = dslContext.select().from(AUTHOR).fetch();

        for (Record r : result) {
            Integer id = r.getValue(AUTHOR.ID);
            String firstName = r.getValue(AUTHOR.FIRST_NAME);
            String lastName = r.getValue(AUTHOR.LAST_NAME);

            System.out.println("ID: " + id + " first name: " + firstName + " last name: " + lastName);
        }
    }
    catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example 2
@Test
public void testFindUsersWithJOOQ() {

    //Query query =     em.createQuery("select u from User u where u.address.country = 'Norway'");
    //Query query = em.createNativeQuery("select * from User where country = 'Norway'");

    DSLContext create = DSL.using(SQLDialect.H2);
    String sql = create
            .select()
            .from(table("User"))
            .where(field("country").eq("Norway"))
            .getSQL(ParamType.INLINED);

    Query query = em.createNativeQuery(sql, User.class);

    List<User> results = query.getResultList();

    assertEquals(3, results.size());

    /*
       JOOQ is a popular, easy to use DSL for writing SQL (not JPQL).
       Besides type-safety and IDE code-completion, one HUGE benefit
       is that the SQL is targeted for the specific dialect of the
       target DB.
     */
}
 
Example 3
Source Project: oneops   Source File: CMSCrawler.java    License: Apache License 2.0 6 votes vote down vote up
private List<Deployment> getDeployments(Connection conn, Environment env) {

        List<Deployment> deployments = new ArrayList<>();
        DSLContext create = DSL.using(conn, SQLDialect.POSTGRES);
        Result<Record> records = create.select().from(DJ_DEPLOYMENT)
                .join(DJ_DEPLOYMENT_STATES).on(DJ_DEPLOYMENT_STATES.STATE_ID.eq(DJ_DEPLOYMENT.STATE_ID))
                .join(NS_NAMESPACES).on(NS_NAMESPACES.NS_ID.eq(DJ_DEPLOYMENT.NS_ID))
                .where(NS_NAMESPACES.NS_PATH.eq(env.getPath()+ "/" + env.getName() + "/bom"))
                .and(DJ_DEPLOYMENT.CREATED_BY.notEqual("oneops-autoreplace"))
                .orderBy(DJ_DEPLOYMENT.CREATED.desc())
                .limit(10)
                .fetch();
        for (Record r : records) {
            Deployment deployment = new Deployment();
            deployment.setCreatedAt(r.getValue(DJ_DEPLOYMENT.CREATED));
            deployment.setCreatedBy(r.getValue(DJ_DEPLOYMENT.CREATED_BY));
            deployment.setState(r.getValue(DJ_DEPLOYMENT_STATES.STATE_NAME));
            deployment.setDeploymentId(r.getValue(DJ_DEPLOYMENT.DEPLOYMENT_ID));
            deployments.add(deployment);
        }
        return deployments;
    }
 
Example 4
Source Project: oneops   Source File: CMSCrawler.java    License: Apache License 2.0 6 votes vote down vote up
private List<Environment> getOneopsEnvironments(Connection conn) {
    List<Environment> envs = new ArrayList<>();
    DSLContext create = DSL.using(conn, SQLDialect.POSTGRES);
    log.info("Fetching all environments..");
    Result<Record> envRecords = create.select().from(CM_CI)
            .join(MD_CLASSES).on(CM_CI.CLASS_ID.eq(MD_CLASSES.CLASS_ID))
            .join(NS_NAMESPACES).on(CM_CI.NS_ID.eq(NS_NAMESPACES.NS_ID))
            .where(MD_CLASSES.CLASS_NAME.eq("manifest.Environment"))
            .fetch(); //all the env cis
    log.info("Got all environments");
    for (Record r : envRecords) {
        long envId = r.getValue(CM_CI.CI_ID);
        //now query attributes for this env
        Environment env = new Environment();
        env.setName(r.getValue(CM_CI.CI_NAME));
        env.setId(r.getValue(CM_CI.CI_ID));
        env.setPath(r.getValue(NS_NAMESPACES.NS_PATH));
        env.setNsId(r.getValue(NS_NAMESPACES.NS_ID));
        envs.add(env);
    }
    return envs;
}
 
Example 5
Source Project: oneops   Source File: CMSCrawler.java    License: Apache License 2.0 6 votes vote down vote up
private List<String> getActiveClouds(Platform platform, Connection conn) {
    DSLContext create = DSL.using(conn, SQLDialect.POSTGRES);
    List<String> clouds = new ArrayList<>();
    Result<Record> consumesRecords = create.select().from(CM_CI_RELATIONS)
            .join(MD_RELATIONS).on(MD_RELATIONS.RELATION_ID.eq(CM_CI_RELATIONS.RELATION_ID))
            .join(CM_CI_RELATION_ATTRIBUTES).on(CM_CI_RELATION_ATTRIBUTES.CI_RELATION_ID.eq(CM_CI_RELATIONS.CI_RELATION_ID))
            .where(CM_CI_RELATIONS.FROM_CI_ID.eq(platform.getId()))
            .and(CM_CI_RELATION_ATTRIBUTES.DF_ATTRIBUTE_VALUE.eq("active"))
            .fetch();
    for (Record r : consumesRecords) {
        String comments = r.getValue(CM_CI_RELATIONS.COMMENTS);
        String cloudName = comments.split(":")[1];
        cloudName = cloudName.split("\"")[1];
        clouds.add(cloudName);
    }
    return clouds;
}
 
Example 6
Source Project: kork   Source File: SqlTestUtil.java    License: Apache License 2.0 6 votes vote down vote up
@Deprecated
public static TestDatabase initPreviousTcMysqlDatabase() {
  MySQLContainer container =
      new MySQLContainer("mysql:5.7.22")
          .withDatabaseName("previous")
          .withUsername("test")
          .withPassword("test");

  container.start();

  String jdbcUrl =
      String.format(
          "%s?user=%s&password=%s",
          container.getJdbcUrl(), container.getUsername(), container.getPassword());

  return initDatabase(jdbcUrl, SQLDialect.MYSQL, "previous");
}
 
Example 7
Source Project: curiostack   Source File: DatabaseModule.java    License: MIT License 6 votes vote down vote up
@Provides
@Singleton
static DSLContext dbContext(
    DataSource dataSource,
    DatabaseConfig config,
    @ForDatabase ListeningExecutorService dbExecutor) {
  Configuration configuration =
      new DefaultConfiguration()
          .set(dbExecutor)
          .set(SQLDialect.MYSQL)
          .set(new Settings().withRenderSchema(false))
          .set(new DataSourceConnectionProvider(dataSource))
          .set(DatabaseUtil.sfmRecordMapperProvider());
  if (config.getLogQueries()) {
    configuration.set(new QueryLogger());
  }
  DSLContext ctx = DSL.using(configuration);
  // Eagerly trigger JOOQ classinit for better startup performance.
  ctx.select().from("curio_server_framework_init").getSQL();
  return ctx;
}
 
Example 8
Source Project: bouncr   Source File: V22__AlterInvitations.java    License: Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void migrate(Context context) throws Exception {
    Connection connection = context.getConnection();
    try(Statement stmt = connection.createStatement()) {
        DSLContext create = DSL.using(connection);
        String ddl = create.alterTable(table("oidc_invitations"))
                .renameColumn(field("oidc_sub")).to(field("oidc_payload", SQLDataType.CLOB))
                .getSQL();
        if (create.configuration().dialect() == SQLDialect.MYSQL) {
            Matcher m = Pattern.compile("\\s+RENAME\\s+COLUMN\\s+(\\w+)\\s+TO\\s+", Pattern.CASE_INSENSITIVE).matcher(ddl);
            StringBuffer sb = new StringBuffer();
            if (m.find()) {
                m.appendReplacement(sb, " change " + m.group(1) + " ");
                m.appendTail(sb);
                sb.append(" text not null");
                ddl = sb.toString();
            }
        }

        stmt.execute(ddl);
    }
}
 
Example 9
@Test
public void testFindUsersWithJOOQ() {

    //Query query =     em.createQuery("select u from User u where u.address.country = 'Norway'");
    //Query query = em.createNativeQuery("select * from User where country = 'Norway'");

    DSLContext create = DSL.using(SQLDialect.H2);
    String sql = create
            .select()
            .from(table("User"))
            .where(field("country").eq("Norway"))
            .getSQL(ParamType.INLINED);

    Query query = em.createNativeQuery(sql, User.class);

    List<User> results = query.getResultList();

    assertEquals(3, results.size());

    /*
       JOOQ is a popular, easy to use DSL for writing SQL (not JPQL).
       Besides type-safety and IDE code-completion, one HUGE benefit
       is that the SQL is targeted for the specific dialect of the
       target DB.
     */
}
 
Example 10
Source Project: waltz   Source File: ServerInformationSearchDao.java    License: Apache License 2.0 6 votes vote down vote up
private FullTextSearch<ServerInformation> determineSearcher(SQLDialect dialect) {

        if (isPostgres(dialect)) {
            return new PostgresServerInformationSearch();
        }

        if (isMariaDB(dialect)) {
            return new MariaServerInformationSearch();
        }

        if (isSQLServer(dialect)) {
            return new SqlServerServerInformationSearch();
        }

        return new UnsupportedSearcher<>(dialect);
    }
 
Example 11
Source Project: waltz   Source File: ApplicationSearchDao.java    License: Apache License 2.0 6 votes vote down vote up
private FullTextSearch<Application> determineSearcher(SQLDialect dialect) {

        if (isPostgres(dialect)) {
            return new PostgresAppSearch();
        }

        if (isMariaDB(dialect)) {
            return new MariaAppSearch();
        }

        if (isSQLServer(dialect)) {
            return new SqlServerAppSearch();
        }

        return new UnsupportedSearcher<>(dialect);
    }
 
Example 12
Source Project: waltz   Source File: OrganisationalUnitSearchDao.java    License: Apache License 2.0 6 votes vote down vote up
private FullTextSearch<OrganisationalUnit> determineSearcher(SQLDialect dialect) {

        if (isPostgres(dialect)) {
            return new PostgresOrganisationalUnitSearch();
        }

        if (isMariaDB(dialect)) {
            return new MariaOrganisationalUnitSearch();
        }

        if (isSQLServer(dialect)) {
            return new SqlServerOrganisationalUnitSearch();
        }

        return new UnsupportedSearcher<>(dialect);
    }
 
Example 13
Source Project: waltz   Source File: ChangeInitiativeSearchDao.java    License: Apache License 2.0 6 votes vote down vote up
private FullTextSearch<ChangeInitiative> determineSearcher(SQLDialect dialect) {

        if (isPostgres(dialect)) {
            return new PostgresChangeInitiativeSearch();
        }

        if (isMariaDB(dialect)) {
            return new MariaChangeInitiativeSearch();
        }

        if (isSQLServer(dialect)) {
            return new SqlServerChangeInitiativeSearch();
        }

        return new UnsupportedSearcher<>(dialect);
    }
 
Example 14
Source Project: waltz   Source File: MeasurableSearchDao.java    License: Apache License 2.0 6 votes vote down vote up
private FullTextSearch<Measurable> determineSearcher(SQLDialect dialect) {

        if (isPostgres(dialect)) {
            return new PostgresMeasurableSearch();
        }

        if (isMariaDB(dialect)) {
            return new MariaMeasurableSearch();
        }

        if (isSQLServer(dialect)) {
            return new SqlServerMeasurableSearch();
        }

        return new UnsupportedSearcher<>(dialect);
    }
 
Example 15
Source Project: SimpleFlatMapper   Source File: JooqMapperTest.java    License: MIT License 6 votes vote down vote up
@Test
public void testIgnoreFields() throws Exception {
	Connection conn = DbHelper.objectDb();

	DSLContext dsl = DSL
			.using(new DefaultConfiguration().set(conn)
					.set(SQLDialect.HSQLDB)
					.set(SfmRecordMapperProviderFactory.newInstance().addAlias("id", "noId").ignorePropertyNotFound().newProvider()));
	
	List<DbObject> list = dsl.select()
			.from("TEST_DB_OBJECT").fetchInto(DbObject.class);
	
	assertEquals(2, list.size());

	assertEquals(0, list.get(0).getId());
	list.get(0).setId(1);
	DbHelper.assertDbObjectMapping(list.get(0));
}
 
Example 16
Source Project: hadoop-ozone   Source File: JooqPersistenceModule.java    License: Apache License 2.0 5 votes vote down vote up
@Provides
@Singleton
Configuration getConfiguration(DefaultDataSourceProvider provider) {
  DataSource dataSource = provider.get();

  return new DefaultConfiguration()
      .set(dataSource)
      .set(new SpringConnectionProvider(dataSource))
      .set(SQLDialect.valueOf(configurationProvider.get().getSqlDialect()));
}
 
Example 17
Source Project: micronaut-sql   Source File: JooqExceptionTranslator.java    License: Apache License 2.0 5 votes vote down vote up
private SQLExceptionTranslator getTranslator(ExecuteContext context) {
    SQLDialect dialect = context.configuration().dialect();
    if (dialect != null && dialect.thirdParty() != null) {
        String dbName = dialect.thirdParty().springDbName();
        if (dbName != null) {
            return new SQLErrorCodeSQLExceptionTranslator(dbName);
        }
    }
    return new SQLStateSQLExceptionTranslator();
}
 
Example 18
Source Project: redpipe   Source File: WikiServer.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected SQLClient createDbClient(JsonObject config) {
	JsonObject myConfig = new JsonObject();
	if(config.containsKey("db_host"))
		myConfig.put("host", config.getString("db_host"));
	if(config.containsKey("db_port"))
		myConfig.put("port", config.getInteger("db_port"));
	if(config.containsKey("db_user"))
		myConfig.put("username", config.getString("db_user"));
	if(config.containsKey("db_pass"))
		myConfig.put("password", config.getString("db_pass"));
	if(config.containsKey("db_name"))
		myConfig.put("database", config.getString("db_name"));
	myConfig.put("max_pool_size", config.getInteger("db_max_pool_size", 30));
	
	Vertx vertx = AppGlobals.get().getVertx();
	AsyncSQLClient dbClient = PostgreSQLClient.createNonShared(vertx, myConfig);

	Configuration configuration = new DefaultConfiguration();
	configuration.set(SQLDialect.POSTGRES);

	PagesDao dao = new PagesDao(configuration, dbClient);
	
	AppGlobals.get().setGlobal(PagesDao.class, dao);
	
	return dbClient;
}
 
Example 19
Source Project: oneops   Source File: CMSCrawler.java    License: Apache License 2.0 5 votes vote down vote up
private void crawlClouds(Connection conn) {

        DSLContext create = DSL.using(conn, SQLDialect.POSTGRES);

        log.info("Fetching all clouds..");
        Result<Record> cloudRecords = create.select().from(CM_CI)
                .join(MD_CLASSES).on(CM_CI.CLASS_ID.eq(MD_CLASSES.CLASS_ID))
                .join(NS_NAMESPACES).on(CM_CI.NS_ID.eq(NS_NAMESPACES.NS_ID))
                .where(MD_CLASSES.CLASS_NAME.eq("account.Cloud"))
                .fetch(); //all the env cis
        log.info("Got all clouds ");


        for (Record r : cloudRecords) {
            if (shutDownRequested) {
                log.info("Shutdown requested, exiting !");
                break;
            }

            long cloudId = r.getValue(CM_CI.CI_ID);
            String cloudName = r.getValue(CM_CI.CI_NAME);
            String cloudNS = r.getValue(NS_NAMESPACES.NS_PATH);
            if (syncClouds) {
                syncCloudVariables(cloudId, cloudName, cloudNS, conn);
            }
        }
    }
 
Example 20
Source Project: droptools   Source File: JooqFactory.java    License: Apache License 2.0 5 votes vote down vote up
private SQLDialect determineDialect(PooledDataSourceFactory dataSourceFactory, ManagedDataSource dataSource) {
    // If a dialect was specified, great!
    if (getDialect().isPresent()) {
        return dialect.get();
    }

    return JDBCUtils.dialect(dataSourceFactory.getUrl());
}
 
Example 21
Source Project: oneops   Source File: CMSCrawler.java    License: Apache License 2.0 5 votes vote down vote up
private void populateEnv(Environment env, Connection conn) {
    DSLContext create = DSL.using(conn, SQLDialect.POSTGRES);
    Result<Record> envAttributes = create.select().from(CM_CI_ATTRIBUTES)
            .join(MD_CLASS_ATTRIBUTES).on(CM_CI_ATTRIBUTES.ATTRIBUTE_ID.eq(MD_CLASS_ATTRIBUTES.ATTRIBUTE_ID))
            .where(CM_CI_ATTRIBUTES.CI_ID.eq(env.getId()))
            .fetch();
    for (Record attrib : envAttributes) {
        String attributeName = attrib.getValue(MD_CLASS_ATTRIBUTES.ATTRIBUTE_NAME);
        if (attributeName.equalsIgnoreCase("profile")) {
            env.setProfile(attrib.getValue(CM_CI_ATTRIBUTES.DF_ATTRIBUTE_VALUE));
        }
        //add other attributes as and when needed
    }
    //now query all the platforms for this env
    Result<Record> platformRels = create.select().from(CM_CI_RELATIONS)
            .join(MD_RELATIONS).on(MD_RELATIONS.RELATION_ID.eq(CM_CI_RELATIONS.RELATION_ID))
            .join(CM_CI).on(CM_CI.CI_ID.eq(CM_CI_RELATIONS.TO_CI_ID))
            .where(MD_RELATIONS.RELATION_NAME.eq("manifest.ComposedOf"))
            .and(CM_CI_RELATIONS.FROM_CI_ID.eq(env.getId()))
            .fetch();
    int totalCores = 0;
    for (Record platformRel : platformRels) {
        long platformId = platformRel.getValue(CM_CI_RELATIONS.TO_CI_ID);
        Platform platform = new Platform();
        platform.setId(platformId);
        platform.setName(platformRel.getValue(CM_CI.CI_NAME));
        platform.setPath(env.getPath() + "/" + env.getName() + "/bom/" + platform.getName() + "/1");
        populatePlatform(conn, platform, platformRel.getValue(CM_CI_RELATIONS.CI_RELATION_ID));
        platform.setActiveClouds(getActiveClouds(platform, conn));
        platform.setCloudsMap(getCloudsDataForPlatform(conn, platformId));
        
        //now calculate total cores of the env - including all platforms
        totalCores += platform.getTotalCores();
        env.addPlatform(platform);
    }
    env.setTotalCores(totalCores);
}
 
Example 22
Source Project: oneops   Source File: CMSCrawler.java    License: Apache License 2.0 5 votes vote down vote up
private void populateBaseOrganizationClassAttribMappingsCache(Connection conn) {
  DSLContext create = DSL.using(conn, SQLDialect.POSTGRES);
  log.debug("populating Organization Class Attribute Mappings Cache");

  this.baseOrganizationMDClassAttributes_NameIdMapCache =
      create.select(MD_CLASS_ATTRIBUTES.ATTRIBUTE_ID, MD_CLASS_ATTRIBUTES.ATTRIBUTE_NAME)
          .from(MD_CLASS_ATTRIBUTES).join(MD_CLASSES)
          .on(MD_CLASS_ATTRIBUTES.CLASS_ID.eq(MD_CLASSES.CLASS_ID))
          .where(MD_CLASSES.CLASS_NAME.eq("base.Organization")).fetch()
          .intoMap(MD_CLASS_ATTRIBUTES.ATTRIBUTE_NAME, MD_CLASS_ATTRIBUTES.ATTRIBUTE_ID);

  log.debug("baseOrganizationMDClassAttributes_NameIdMapCache: entrySet"
      + this.baseOrganizationMDClassAttributes_NameIdMapCache.entrySet());

}
 
Example 23
Source Project: java-crud-api   Source File: ColumnDefinition.java    License: MIT License 5 votes vote down vote up
private void override(DSLContext dsl) {
	if (dsl.dialect() == SQLDialect.H2) {
		if (type.equals("geometry")) {
			type = "nclob";
		}
	}
}
 
Example 24
Source Project: SimpleFlatMapper   Source File: JooqMapperTest.java    License: MIT License 5 votes vote down vote up
@Test
public void testMapperDbObject() throws Exception {
	Connection conn = DbHelper.objectDb();

	DSLContext dsl = DSL
			.using(new DefaultConfiguration().set(conn)
					.set(SQLDialect.HSQLDB)
					.set(new SfmRecordMapperProvider()));

	List<DbObject> list = dsl.select()
			.from("TEST_DB_OBJECT").fetchInto(DbObject.class);

	assertEquals(2, list.size());
	DbHelper.assertDbObjectMapping(list.get(0));
}
 
Example 25
Source Project: java-crud-api   Source File: SpatialDSL.java    License: MIT License 5 votes vote down vote up
public static void registerDataTypes(DSLContext dsl) {
	SQLDialect dialect = dsl.dialect();
	switch (dialect.family().toString()) {
	case "MYSQL":
	case "POSTGRES":
	case "SQLSERVER":
		DefaultDataType.getDefaultDataType(SQLDialect.DEFAULT, "geometry");
		break;
	}
}
 
Example 26
Source Project: tutorials   Source File: PersistenceContextIntegrationTest.java    License: MIT License 5 votes vote down vote up
@Bean
public DefaultConfiguration configuration() {
    DefaultConfiguration jooqConfiguration = new DefaultConfiguration();
    jooqConfiguration.set(connectionProvider());
    jooqConfiguration.set(new DefaultExecuteListenerProvider(exceptionTransformer()));

    String sqlDialectName = environment.getRequiredProperty("jooq.sql.dialect");
    SQLDialect dialect = SQLDialect.valueOf(sqlDialectName);
    jooqConfiguration.set(dialect);

    return jooqConfiguration;
}
 
Example 27
Source Project: StubbornJava   Source File: JooqConfig.java    License: MIT License 5 votes vote down vote up
public static Configuration defaultConfigFromDataSource(DataSource ds) {
    DataSourceConnectionProvider dcp = new DataSourceConnectionProvider(ds);
    Configuration jooqConfig = new DefaultConfiguration();
    jooqConfig.set(SQLDialect.MYSQL);
    jooqConfig.set(dcp);
    //jooqConfig.set(new ThreadLocalTransactionProvider(dcp));
    jooqConfig.settings()
              .withExecuteWithOptimisticLockingExcludeUnversioned(true);
    return jooqConfig;
}
 
Example 28
Source Project: JOOQ   Source File: ScopedContext.java    License: Apache License 2.0 5 votes vote down vote up
public DSLContext getDSLContext() {
    if (dslContext == null) {
        Configuration defaultConfiguration = new DefaultConfiguration().set(getConnection())
                .set(SQLDialect.MYSQL);

        dslContext = DSL.using(defaultConfiguration);
    }

    return dslContext;
}
 
Example 29
Source Project: droptools   Source File: JooqFactoryTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void usesSpecifiedDialect() throws Exception {
    when(dataSourceFactory.getUrl()).thenReturn("jdbc:postgresql://localhost:5432/test");

    factory.setDialect(Optional.of(SQLDialect.DERBY));
    Configuration config = factory.build(environment, dataSourceFactory);
    assertThat(config.dialect()).isEqualTo(SQLDialect.DERBY);
}
 
Example 30
Source Project: hmftools   Source File: DatabaseAccess.java    License: GNU General Public License v3.0 5 votes vote down vote up
public DatabaseAccess(@NotNull final String userName, @NotNull final String password, @NotNull final String url) throws SQLException {
    // Disable annoying jooq self-ad message
    System.setProperty("org.jooq.no-logo", "true");
    Connection conn = DriverManager.getConnection(url, userName, password);
    String catalog = conn.getCatalog();
    LOGGER.debug("Connecting to database {}", catalog);
    this.context = DSL.using(conn, SQLDialect.MYSQL, settings(catalog));

    ecrfDAO = new EcrfDAO(context);
    clinicalDAO = new ClinicalDAO(context);
    validationFindingsDAO = new ValidationFindingDAO(context);
    rnaDAO = new RNADAO(context);
    purityDAO = new PurityDAO(context);
    amberDAO = new AmberDAO(context);
    metricDAO = new MetricDAO(context);
    pgxDAO = new PgxDAO(context);
    copyNumberDAO = new CopyNumberDAO(context);
    geneCopyNumberDAO = new GeneCopyNumberDAO(context);
    somaticVariantDAO = new SomaticVariantDAO(context);
    structuralVariantDAO = new StructuralVariantDAO(context);
    structuralVariantClusterDAO = new StructuralVariantClusterDAO(context);
    structuralVariantFusionDAO = new StructuralVariantFusionDAO(context);
    canonicalTranscriptDAO = new CanonicalTranscriptDAO(context);
    driverCatalogDAO = new DriverCatalogDAO(context);
    chordDAO = new ChordDAO(context);
    clinicalEvidenceDAO = new ClinicalEvidenceDAO(context);
}