This is Spring Data module for a MapDB: database engine Many thanks to Spring Data Hazelcast for an inspiration.
<dependency>
<groupId>com.github.mrfrag</groupId>
<artifactId>spring-data-mapdb</artifactId>
<version>0.1.0</version>
</dependency>
Configuration sample.
@Configuration
@EnableMapDbRepositories(basePackages = "your.fancy.package")
public class RepositoryConfiguration {
@Bean
public KeyValueTemplate keyValueTemplate() {
return new KeyValueTemplate(new MapDbKeyValueAdapter());
}
}
or
@Configuration
@EnableMapDbRepositories(basePackageClasses = { YourFancyRepository.class})
public class RepositoryConfiguration {
@Bean
public KeyValueTemplate keyValueTemplate() {
DB db = DBMaker.fileDB("/wherever/it/is/foo.db").make();
return new KeyValueTemplate(new MapDbKeyValueAdapter(db));
}
}
for detailed example check src/test/java/org/springframework/data/mapdb/example/
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
MIT License