use of io.requery.cache.WeakEntityCache in project requery by requery.
the class JacksonTest method setup.
@Before
public void setup() throws SQLException {
CommonDataSource dataSource = DatabaseType.getDataSource(new SQLite());
EntityModel model = Models.MODEL3;
Configuration configuration = new ConfigurationBuilder(dataSource, model).useDefaultLogging().setEntityCache(new WeakEntityCache()).setWriteExecutor(Executors.newSingleThreadExecutor()).build();
SchemaModifier tables = new SchemaModifier(configuration);
tables.createTables(TableCreationMode.DROP_CREATE);
data = new EntityDataStore<>(configuration);
}
use of io.requery.cache.WeakEntityCache in project requery by requery.
the class DatabaseConfiguration method provideDataStore.
@Bean
public EntityDataStore<Persistable> provideDataStore() {
ConnectionProvider connectionProvider = new ConnectionProvider() {
@Override
public Connection getConnection() throws SQLException {
return DriverManager.getConnection("jdbc:h2:~/test", "sa", "");
}
};
io.requery.sql.Configuration configuration = new ConfigurationBuilder(connectionProvider, Models.DEFAULT).useDefaultLogging().setEntityCache(new WeakEntityCache()).setWriteExecutor(Executors.newSingleThreadExecutor()).build();
SchemaModifier tables = new SchemaModifier(configuration);
tables.createTables(TableCreationMode.DROP_CREATE);
return new EntityDataStore<>(configuration);
}
Aggregations