use of io.requery.sql.Platform in project requery by requery.
the class RxTest method setup.
@Before
public void setup() throws SQLException {
Platform platform = new HSQL();
CommonDataSource dataSource = DatabaseType.getDataSource(platform);
EntityModel model = io.requery.test.model.Models.DEFAULT;
CachingProvider provider = Caching.getCachingProvider();
CacheManager cacheManager = provider.getCacheManager();
Configuration configuration = new ConfigurationBuilder(dataSource, model).useDefaultLogging().setWriteExecutor(Executors.newSingleThreadExecutor()).setEntityCache(new EntityCacheBuilder(model).useReferenceCache(true).useSerializableCache(true).useCacheManager(cacheManager).build()).build();
SchemaModifier tables = new SchemaModifier(configuration);
tables.createTables(TableCreationMode.DROP_CREATE);
data = RxSupport.toReactiveStore(new EntityDataStore<Persistable>(configuration));
}
use of io.requery.sql.Platform in project requery by requery.
the class ReactorTest method setup.
@Before
public void setup() throws SQLException {
Platform platform = new HSQL();
CommonDataSource dataSource = DatabaseType.getDataSource(platform);
EntityModel model = io.requery.test.model.Models.DEFAULT;
CachingProvider provider = Caching.getCachingProvider();
CacheManager cacheManager = provider.getCacheManager();
Configuration configuration = new ConfigurationBuilder(dataSource, model).useDefaultLogging().setWriteExecutor(Executors.newSingleThreadExecutor()).setEntityCache(new EntityCacheBuilder(model).useReferenceCache(true).useSerializableCache(true).useCacheManager(cacheManager).build()).build();
SchemaModifier tables = new SchemaModifier(configuration);
tables.createTables(TableCreationMode.DROP_CREATE);
data = new ReactorEntityStore<>(new EntityDataStore<Persistable>(configuration));
}
use of io.requery.sql.Platform in project requery by requery.
the class TimeConversionsTest method setup.
@Before
public void setup() throws SQLException {
Platform platform = new HSQL();
CommonDataSource dataSource = DatabaseType.getDataSource(platform);
EntityModel model = Models.MODEL2;
Configuration configuration = new ConfigurationBuilder(dataSource, model).useDefaultLogging().setEntityCache(new EmptyEntityCache()).setWriteExecutor(Executors.newSingleThreadExecutor()).build();
SchemaModifier tables = new SchemaModifier(configuration);
tables.createTables(TableCreationMode.DROP_CREATE);
data = new EntityDataStore<>(configuration);
}
use of io.requery.sql.Platform in project requery by requery.
the class ReactiveTest method setup.
@Before
public void setup() throws SQLException {
Platform platform = new HSQL();
CommonDataSource dataSource = DatabaseType.getDataSource(platform);
EntityModel model = io.requery.test.model.Models.DEFAULT;
CachingProvider provider = Caching.getCachingProvider();
CacheManager cacheManager = provider.getCacheManager();
Configuration configuration = new ConfigurationBuilder(dataSource, model).useDefaultLogging().setWriteExecutor(Executors.newSingleThreadExecutor()).setEntityCache(new EntityCacheBuilder(model).useReferenceCache(true).useSerializableCache(true).useCacheManager(cacheManager).build()).build();
SchemaModifier tables = new SchemaModifier(configuration);
tables.createTables(TableCreationMode.DROP_CREATE);
data = ReactiveSupport.toReactiveStore(new EntityDataStore<Persistable>(configuration));
}
use of io.requery.sql.Platform in project requery by requery.
the class CompletableEntityStoreTest method setup.
@Before
public void setup() throws SQLException {
Platform platform = new HSQL();
CommonDataSource dataSource = DatabaseType.getDataSource(platform);
EntityModel model = io.requery.test.model.Models.DEFAULT;
final TransactionListener transactionListener = new TransactionListener() {
@Override
public void beforeBegin(TransactionIsolation isolation) {
}
@Override
public void afterBegin(TransactionIsolation isolation) {
transactionState = TransactionState.BEGIN;
}
@Override
public void beforeCommit(Set<Type<?>> types) {
}
@Override
public void afterCommit(Set<Type<?>> types) {
transactionState = TransactionState.COMMIT;
}
@Override
public void beforeRollback(Set<Type<?>> types) {
}
@Override
public void afterRollback(Set<Type<?>> types) {
transactionState = TransactionState.ROLLBACK;
}
};
Configuration configuration = new ConfigurationBuilder(dataSource, model).useDefaultLogging().setStatementCacheSize(10).setBatchUpdateSize(50).setWriteExecutor(Executors.newSingleThreadExecutor()).addTransactionListenerFactory(new Supplier<TransactionListener>() {
@Override
public TransactionListener get() {
return transactionListener;
}
}).build();
data = new CompletableEntityStore<>(new EntityDataStore<Persistable>(configuration));
SchemaModifier tables = new SchemaModifier(configuration);
tables.createTables(TableCreationMode.DROP_CREATE);
}
Aggregations