All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lordofthejars.nosqlunit.demo.couchdb.BookManager Maven / Gradle / Ivy

There is a newer version: 1.0.0-rc.5
Show newest version
package com.lordofthejars.nosqlunit.demo.couchdb;

import java.util.Map;

import org.ektorp.CouchDbConnector;

import com.lordofthejars.nosqlunit.demo.model.Book;

public class BookManager {

	private CouchDbConnector connector;
	
	public BookManager(CouchDbConnector connector)  {
		this.connector = connector;
	}
	
	public void create(Book book) {
		connector.create(MapBookConverter.toMap(book));
	}

	public Book findBookById(String id) {
		Map map = connector.get(Map.class, id);
		return MapBookConverter.toBook(map);
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy