ttimbul / spring-data-mapdb

Spring Data module for MapDB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spring Data MapDB

This is Spring Data module for a MapDB: database engine Many thanks to Spring Data Hazelcast for an inspiration.

Installation

<dependency>
    <groupId>com.github.mrfrag</groupId>
    <artifactId>spring-data-mapdb</artifactId>
    <version>0.1.0</version>
</dependency>

Usage

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/

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

MIT License

About

Spring Data module for MapDB

License:MIT License


Languages

Language:Java 100.0%