Search in sources :

Example 1 with DBCPDataSourceServiceAssembler

use of org.qi4j.library.sql.dbcp.DBCPDataSourceServiceAssembler in project qi4j-sdk by Qi4j.

the class SQLiteEntityStoreTest method assemble.

@Override
public // START SNIPPET: assembly
void assemble(ModuleAssembly module) throws AssemblyException {
    // END SNIPPET: assembly
    super.assemble(module);
    ModuleAssembly config = module.layer().module("config");
    new EntityTestAssembler().assemble(config);
    new OrgJsonValueSerializationAssembler().assemble(module);
    // START SNIPPET: assembly
    // DataSourceService
    new DBCPDataSourceServiceAssembler().identifiedBy("sqlite-datasource-service").visibleIn(Visibility.module).withConfig(config, Visibility.layer).assemble(module);
    // DataSource
    new DataSourceAssembler().withDataSourceServiceIdentity("sqlite-datasource-service").identifiedBy("sqlite-datasource").visibleIn(Visibility.module).withCircuitBreaker().assemble(module);
    // SQL EntityStore
    new SQLiteEntityStoreAssembler().visibleIn(Visibility.application).withConfig(config, Visibility.layer).assemble(module);
}
Also used : ModuleAssembly(org.qi4j.bootstrap.ModuleAssembly) DataSourceAssembler(org.qi4j.library.sql.assembly.DataSourceAssembler) EntityTestAssembler(org.qi4j.test.EntityTestAssembler) DBCPDataSourceServiceAssembler(org.qi4j.library.sql.dbcp.DBCPDataSourceServiceAssembler) OrgJsonValueSerializationAssembler(org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler) SQLiteEntityStoreAssembler(org.qi4j.entitystore.sql.assembly.SQLiteEntityStoreAssembler)

Example 2 with DBCPDataSourceServiceAssembler

use of org.qi4j.library.sql.dbcp.DBCPDataSourceServiceAssembler in project qi4j-sdk by Qi4j.

the class DerbySQLEntityStoreTest method assemble.

@Override
public // START SNIPPET: assembly
void assemble(ModuleAssembly module) throws AssemblyException {
    // END SNIPPET: assembly
    super.assemble(module);
    ModuleAssembly config = module.layer().module("config");
    new EntityTestAssembler().assemble(config);
    new OrgJsonValueSerializationAssembler().assemble(module);
    // START SNIPPET: assembly
    // DataSourceService
    new DBCPDataSourceServiceAssembler().identifiedBy("derby-datasource-service").visibleIn(Visibility.module).withConfig(config, Visibility.layer).assemble(module);
    // DataSource
    new DataSourceAssembler().withDataSourceServiceIdentity("derby-datasource-service").identifiedBy("derby-datasource").visibleIn(Visibility.module).withCircuitBreaker().assemble(module);
    // SQL EntityStore
    new DerbySQLEntityStoreAssembler().visibleIn(Visibility.application).withConfig(config, Visibility.layer).assemble(module);
}
Also used : ModuleAssembly(org.qi4j.bootstrap.ModuleAssembly) DataSourceAssembler(org.qi4j.library.sql.assembly.DataSourceAssembler) EntityTestAssembler(org.qi4j.test.EntityTestAssembler) DBCPDataSourceServiceAssembler(org.qi4j.library.sql.dbcp.DBCPDataSourceServiceAssembler) DerbySQLEntityStoreAssembler(org.qi4j.entitystore.sql.assembly.DerbySQLEntityStoreAssembler) OrgJsonValueSerializationAssembler(org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler)

Example 3 with DBCPDataSourceServiceAssembler

use of org.qi4j.library.sql.dbcp.DBCPDataSourceServiceAssembler in project qi4j-sdk by Qi4j.

the class H2SQLEntityStoreTest method assemble.

@Override
public // START SNIPPET: assembly
void assemble(ModuleAssembly module) throws AssemblyException {
    // END SNIPPET: assembly
    super.assemble(module);
    ModuleAssembly config = module.layer().module("config");
    new EntityTestAssembler().assemble(config);
    new OrgJsonValueSerializationAssembler().assemble(module);
    // START SNIPPET: assembly
    // DataSourceService
    new DBCPDataSourceServiceAssembler().identifiedBy("h2-datasource-service").visibleIn(Visibility.module).withConfig(config, Visibility.layer).assemble(module);
    // DataSource
    new DataSourceAssembler().withDataSourceServiceIdentity("h2-datasource-service").identifiedBy("h2-datasource").visibleIn(Visibility.module).withCircuitBreaker().assemble(module);
    // SQL EntityStore
    new H2SQLEntityStoreAssembler().visibleIn(Visibility.application).withConfig(config, Visibility.layer).assemble(module);
}
Also used : ModuleAssembly(org.qi4j.bootstrap.ModuleAssembly) DataSourceAssembler(org.qi4j.library.sql.assembly.DataSourceAssembler) H2SQLEntityStoreAssembler(org.qi4j.entitystore.sql.assembly.H2SQLEntityStoreAssembler) EntityTestAssembler(org.qi4j.test.EntityTestAssembler) DBCPDataSourceServiceAssembler(org.qi4j.library.sql.dbcp.DBCPDataSourceServiceAssembler) OrgJsonValueSerializationAssembler(org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler)

Example 4 with DBCPDataSourceServiceAssembler

use of org.qi4j.library.sql.dbcp.DBCPDataSourceServiceAssembler in project qi4j-sdk by Qi4j.

the class SQLTestHelper method doCommonAssembling.

protected static void doCommonAssembling(ModuleAssembly mainModule) throws AssemblyException {
    ModuleAssembly config = mainModule.layer().module("config");
    new EntityTestAssembler().assemble(config);
    // START SNIPPET: assembly
    // DataSourceService
    new DBCPDataSourceServiceAssembler().identifiedBy("postgres-datasource-service").visibleIn(Visibility.module).withConfig(config, Visibility.layer).assemble(mainModule);
    // DataSource
    new DataSourceAssembler().withDataSourceServiceIdentity("postgres-datasource-service").identifiedBy("postgres-datasource").visibleIn(Visibility.module).withCircuitBreaker().assemble(mainModule);
    // SQL Index/Query
    new PostgreSQLIndexQueryAssembler().visibleIn(Visibility.module).withConfig(config, Visibility.layer).assemble(mainModule);
    // END SNIPPET: assembly
    // Always re-build schema in test scenarios because of possibly different app structure in
    // various tests
    mainModule.services(RebuildingStrategy.class).withMixins(RebuildingStrategy.AlwaysNeed.class).visibleIn(Visibility.module);
    // Always re-index in test scenarios
    mainModule.services(ReindexingStrategy.class).withMixins(ReindexingStrategy.AlwaysNeed.class).visibleIn(Visibility.module);
    config.entities(ReindexerConfiguration.class).visibleIn(Visibility.layer);
}
Also used : ModuleAssembly(org.qi4j.bootstrap.ModuleAssembly) DataSourceAssembler(org.qi4j.library.sql.assembly.DataSourceAssembler) EntityTestAssembler(org.qi4j.test.EntityTestAssembler) PostgreSQLIndexQueryAssembler(org.qi4j.index.sql.assembly.PostgreSQLIndexQueryAssembler) ReindexerConfiguration(org.qi4j.index.reindexer.ReindexerConfiguration) DBCPDataSourceServiceAssembler(org.qi4j.library.sql.dbcp.DBCPDataSourceServiceAssembler)

Example 5 with DBCPDataSourceServiceAssembler

use of org.qi4j.library.sql.dbcp.DBCPDataSourceServiceAssembler in project qi4j-sdk by Qi4j.

the class DerbySQLEntityStorePerformanceTest method createAssembler.

private static Assembler createAssembler() {
    return new Assembler() {

        @Override
        public void assemble(ModuleAssembly module) throws AssemblyException {
            ModuleAssembly config = module.layer().module("config");
            new EntityTestAssembler().assemble(config);
            new OrgJsonValueSerializationAssembler().assemble(module);
            // DataSourceService
            new DBCPDataSourceServiceAssembler().identifiedBy("derby-datasource-service").visibleIn(Visibility.module).withConfig(config, Visibility.layer).assemble(module);
            // DataSource
            new DataSourceAssembler().withDataSourceServiceIdentity("derby-datasource-service").identifiedBy("derby-datasource").withCircuitBreaker().assemble(module);
            // SQL EntityStore
            new DerbySQLEntityStoreAssembler().withConfig(config, Visibility.layer).assemble(module);
        }
    };
}
Also used : ModuleAssembly(org.qi4j.bootstrap.ModuleAssembly) DataSourceAssembler(org.qi4j.library.sql.assembly.DataSourceAssembler) EntityTestAssembler(org.qi4j.test.EntityTestAssembler) DBCPDataSourceServiceAssembler(org.qi4j.library.sql.dbcp.DBCPDataSourceServiceAssembler) DBCPDataSourceServiceAssembler(org.qi4j.library.sql.dbcp.DBCPDataSourceServiceAssembler) DerbySQLEntityStoreAssembler(org.qi4j.entitystore.sql.assembly.DerbySQLEntityStoreAssembler) Assembler(org.qi4j.bootstrap.Assembler) DataSourceAssembler(org.qi4j.library.sql.assembly.DataSourceAssembler) EntityTestAssembler(org.qi4j.test.EntityTestAssembler) OrgJsonValueSerializationAssembler(org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler) DerbySQLEntityStoreAssembler(org.qi4j.entitystore.sql.assembly.DerbySQLEntityStoreAssembler) OrgJsonValueSerializationAssembler(org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler)

Aggregations

ModuleAssembly (org.qi4j.bootstrap.ModuleAssembly)9 DataSourceAssembler (org.qi4j.library.sql.assembly.DataSourceAssembler)9 DBCPDataSourceServiceAssembler (org.qi4j.library.sql.dbcp.DBCPDataSourceServiceAssembler)9 EntityTestAssembler (org.qi4j.test.EntityTestAssembler)7 OrgJsonValueSerializationAssembler (org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler)6 PostgreSQLEntityStoreAssembler (org.qi4j.entitystore.sql.assembly.PostgreSQLEntityStoreAssembler)3 Assembler (org.qi4j.bootstrap.Assembler)2 DerbySQLEntityStoreAssembler (org.qi4j.entitystore.sql.assembly.DerbySQLEntityStoreAssembler)2 PostgreSQLIndexQueryAssembler (org.qi4j.index.sql.assembly.PostgreSQLIndexQueryAssembler)2 ApplicationAssembly (org.qi4j.bootstrap.ApplicationAssembly)1 LayerAssembly (org.qi4j.bootstrap.LayerAssembly)1 H2SQLEntityStoreAssembler (org.qi4j.entitystore.sql.assembly.H2SQLEntityStoreAssembler)1 MySQLEntityStoreAssembler (org.qi4j.entitystore.sql.assembly.MySQLEntityStoreAssembler)1 SQLiteEntityStoreAssembler (org.qi4j.entitystore.sql.assembly.SQLiteEntityStoreAssembler)1 ReindexerConfiguration (org.qi4j.index.reindexer.ReindexerConfiguration)1