Skip to content

krishnanunnijs/spring-data-mapdb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%