// Path: myeslib-core/src/main/java/org/myeslib/core/data/UnitOfWork.java
// @SuppressWarnings("serial")
// @Value
// public class UnitOfWork implements Comparable<UnitOfWork>, Serializable {
// 
//     final UUID id;
// 	final Command command;
// 	final List<? extends Event> events;
// 	final long version;
// 	
// 	public UnitOfWork(UUID id, Command command, Long version, List<? extends Event> events) {
// 	    checkNotNull(id, "id cannot be null");
// 	    checkNotNull(command, "command cannot be null");
// 		checkArgument(command.getTargetVersion()>=0, "target version must be >= 0");
// 		checkArgument(version>0, "invalid version");
// 		checkNotNull(events, "events cannot be null");
// 		for (Event e: events){
// 			checkNotNull(e, "event within events list cannot be null");
// 		}
// 		this.id = id;
// 		this.command = command;
// 		this.version = version;
// 		this.events = events;
// 	}
// 	
// 	public static UnitOfWork create(UUID id, Command command, List<? extends Event> newEvents) {
// 		checkNotNull(command.getTargetVersion(), "target version cannot be null");
// 		checkArgument(command.getTargetVersion()>=0, "target version must be >= 0");
// 		return new UnitOfWork(id, command, command.getTargetVersion()+1, newEvents);
// 	}
// 	
// 	public List<Event> getEvents(){
// 		List<Event> result = new LinkedList<>();
// 		for (Event event : events) {
// 			result.add(event);
// 		}
// 		return result;
// 	}
// 	
// 	public int compareTo(UnitOfWork other) {
// 		if (version < other.version) {
// 			return -1;
// 		} else if (version > other.version) {
// 			return 1;
// 		}
// 		return 0;
// 	}
// 
// 	public Long getTargetVersion() {
// 		return command.getTargetVersion();
// 	}
// }
// 
// Path: myeslib-core/src/main/java/org/myeslib/core/storage/UnitOfWorkJournal.java
// public interface UnitOfWorkJournal<K> {
// 
// 	public void append(final K id, final UnitOfWork uow) ;
// 	
// }
// 
// Path: myeslib-util/src/main/java/org/myeslib/util/jdbi/UnitOfWorkJournalDao.java
// public interface UnitOfWorkJournalDao<K> {
// 
// 	void append(K id, UnitOfWork uow);
// 	
// }


import org.myeslib.core.data.UnitOfWork;
import org.myeslib.core.storage.UnitOfWorkJournal;
import org.myeslib.util.jdbi.UnitOfWorkJournalDao;
import com.google.inject.Inject;
package org.myeslib.jdbi.storage;



public class JdbiUnitOfWorkJournal<K> implements UnitOfWorkJournal<K> {
	
	@Inject
	public JdbiUnitOfWorkJournal(UnitOfWorkJournalDao<K> dao) {
		this.dao = dao;
	}

	private final UnitOfWorkJournalDao<K> dao;
	
	/*
	 * (non-Javadoc)
	 * @see org.myeslib.core.storage.UnitOfWorkJournal#append(java.lang.Object, org.myeslib.core.data.UnitOfWork)
	 */
	public void append(final K id, final UnitOfWork uow) {
		
// Path: myeslib-core/src/main/java/org/myeslib/core/data/UnitOfWork.java
// @SuppressWarnings("serial")
// @Value
// public class UnitOfWork implements Comparable<UnitOfWork>, Serializable {
// 
//     final UUID id;
// 	final Command command;
// 	final List<? extends Event> events;
// 	final long version;
// 	
// 	public UnitOfWork(UUID id, Command command, Long version, List<? extends Event> events) {
// 	    checkNotNull(id, "id cannot be null");
// 	    checkNotNull(command, "command cannot be null");
// 		checkArgument(command.getTargetVersion()>=0, "target version must be >= 0");
// 		checkArgument(version>0, "invalid version");
// 		checkNotNull(events, "events cannot be null");
// 		for (Event e: events){
// 			checkNotNull(e, "event within events list cannot be null");
// 		}
// 		this.id = id;
// 		this.command = command;
// 		this.version = version;
// 		this.events = events;
// 	}
// 	
// 	public static UnitOfWork create(UUID id, Command command, List<? extends Event> newEvents) {
// 		checkNotNull(command.getTargetVersion(), "target version cannot be null");
// 		checkArgument(command.getTargetVersion()>=0, "target version must be >= 0");
// 		return new UnitOfWork(id, command, command.getTargetVersion()+1, newEvents);
// 	}
// 	
// 	public List<Event> getEvents(){
// 		List<Event> result = new LinkedList<>();
// 		for (Event event : events) {
// 			result.add(event);
// 		}
// 		return result;
// 	}
// 	
// 	public int compareTo(UnitOfWork other) {
// 		if (version < other.version) {
// 			return -1;
// 		} else if (version > other.version) {
// 			return 1;
// 		}
// 		return 0;
// 	}
// 
// 	public Long getTargetVersion() {
// 		return command.getTargetVersion();
// 	}
// }
// 
// Path: myeslib-core/src/main/java/org/myeslib/core/storage/UnitOfWorkJournal.java
// public interface UnitOfWorkJournal<K> {
// 
// 	public void append(final K id, final UnitOfWork uow) ;
// 	
// }
// 
// Path: myeslib-util/src/main/java/org/myeslib/util/jdbi/UnitOfWorkJournalDao.java
// public interface UnitOfWorkJournalDao<K> {
// 
// 	void append(K id, UnitOfWork uow);
// 	
// }


// Path: myeslib-jdbi/src/main/java/org/myeslib/jdbi/storage/JdbiUnitOfWorkJournal.java
import org.myeslib.core.data.UnitOfWork;
import org.myeslib.core.storage.UnitOfWorkJournal;
import org.myeslib.util.jdbi.UnitOfWorkJournalDao;
import com.google.inject.Inject;

package org.myeslib.jdbi.storage;



public class JdbiUnitOfWorkJournal<K> implements UnitOfWorkJournal<K> {
	
	@Inject
	public JdbiUnitOfWorkJournal(UnitOfWorkJournalDao<K> dao) {
		this.dao = dao;
	}

	private final UnitOfWorkJournalDao<K> dao;
	
	/*
	 * (non-Javadoc)
	 * @see org.myeslib.core.storage.UnitOfWorkJournal#append(java.lang.Object, org.myeslib.core.data.UnitOfWork)
	 */
	public void append(final K id, final UnitOfWork uow) {
		
		dao.append(id, uow);