Search in sources :

Example 1 with H2DatabasePlatform

use of com.manydesigns.portofino.database.platforms.H2DatabasePlatform in project Portofino by ManyDesigns.

the class PersistenceTest method setup.

protected void setup(FileObject appDir) throws Exception {
    Configuration configuration = new PropertiesConfiguration();
    final DatabasePlatformsRegistry databasePlatformsRegistry = new DatabasePlatformsRegistry(configuration);
    databasePlatformsRegistry.addDatabasePlatform(new H2DatabasePlatform());
    databaseModule = new DatabaseModule() {

        @Override
        public void destroy() {
            if (subscription != null) {
                subscription.dispose();
                subscription = null;
            }
        }
    };
    databaseModule.applicationDirectory = appDir;
    databaseModule.configuration = new ConfigurationSource(configuration, null);
    persistence = databaseModule.getPersistence(databasePlatformsRegistry, new CacheResetListenerRegistry());
    databaseModule.init();
    persistence.start();
    setupJPetStore();
    setupHibernateTest();
    persistence.initModel();
}
Also used : H2DatabasePlatform(com.manydesigns.portofino.database.platforms.H2DatabasePlatform) ConfigurationSource(com.manydesigns.portofino.config.ConfigurationSource) Configuration(org.apache.commons.configuration2.Configuration) PropertiesConfiguration(org.apache.commons.configuration2.PropertiesConfiguration) DatabasePlatformsRegistry(com.manydesigns.portofino.model.database.platforms.DatabasePlatformsRegistry) CacheResetListenerRegistry(com.manydesigns.portofino.cache.CacheResetListenerRegistry) DatabaseModule(com.manydesigns.portofino.modules.DatabaseModule) PropertiesConfiguration(org.apache.commons.configuration2.PropertiesConfiguration)

Example 2 with H2DatabasePlatform

use of com.manydesigns.portofino.database.platforms.H2DatabasePlatform in project Portofino by ManyDesigns.

the class CrudActionTest method setup.

protected void setup(FileObject appDir) throws Exception {
    Configuration configuration = new PropertiesConfiguration();
    DatabasePlatformsRegistry databasePlatformsRegistry = new DatabasePlatformsRegistry(configuration);
    databasePlatformsRegistry.addDatabasePlatform(new H2DatabasePlatform());
    persistence = new Persistence(appDir, new ConfigurationSource(configuration, null), databasePlatformsRegistry);
    persistence.start();
    setupJPetStore();
    persistence.initModel();
}
Also used : Persistence(com.manydesigns.portofino.persistence.Persistence) H2DatabasePlatform(com.manydesigns.portofino.database.platforms.H2DatabasePlatform) ConfigurationSource(com.manydesigns.portofino.config.ConfigurationSource) CrudConfiguration(com.manydesigns.portofino.resourceactions.crud.configuration.database.CrudConfiguration) Configuration(org.apache.commons.configuration2.Configuration) PropertiesConfiguration(org.apache.commons.configuration2.PropertiesConfiguration) DatabasePlatformsRegistry(com.manydesigns.portofino.model.database.platforms.DatabasePlatformsRegistry) PropertiesConfiguration(org.apache.commons.configuration2.PropertiesConfiguration)

Example 3 with H2DatabasePlatform

use of com.manydesigns.portofino.database.platforms.H2DatabasePlatform in project Portofino by ManyDesigns.

the class H2Module method init.

@PostConstruct
public void init() {
    databasePlatformsRegistry.addDatabasePlatform(new H2DatabasePlatform());
    status = ModuleStatus.STARTED;
}
Also used : H2DatabasePlatform(com.manydesigns.portofino.database.platforms.H2DatabasePlatform) PostConstruct(javax.annotation.PostConstruct)

Aggregations

H2DatabasePlatform (com.manydesigns.portofino.database.platforms.H2DatabasePlatform)3 ConfigurationSource (com.manydesigns.portofino.config.ConfigurationSource)2 DatabasePlatformsRegistry (com.manydesigns.portofino.model.database.platforms.DatabasePlatformsRegistry)2 Configuration (org.apache.commons.configuration2.Configuration)2 PropertiesConfiguration (org.apache.commons.configuration2.PropertiesConfiguration)2 CacheResetListenerRegistry (com.manydesigns.portofino.cache.CacheResetListenerRegistry)1 DatabaseModule (com.manydesigns.portofino.modules.DatabaseModule)1 Persistence (com.manydesigns.portofino.persistence.Persistence)1 CrudConfiguration (com.manydesigns.portofino.resourceactions.crud.configuration.database.CrudConfiguration)1 PostConstruct (javax.annotation.PostConstruct)1