// Path: micro-genie-application/src/main/java/io/microgenie/application/database/EntityDatabusRepository.java
// public static class Key{
// 	private String hash;
// 	private String range;
// 	public Key(){}
// 	public Key(final String hash){
// 		this.hash = hash;
// 	}
// 	public Key(final String hash, final String range){
// 		this.hash = hash;
// 		this.range = range;
// 	}
// 	public static Key create(final String hash){
// 		return create(hash, null);
// 	}
// 	public static Key create(final String hash, final String range){
// 		return new Key(hash, range);
// 	}
// 	public String getHash() {
// 		return hash;
// 	}
// 	public void setHash(final String hash) {
// 		this.hash = hash;
// 	}
// 	public String getRange() {
// 		return range;
// 	}
// 	public void setRange(final String range) {
// 		this.range = range;
// 	}
// 	@Override
// 	public int hashCode(){
// 		return HashCodeBuilder.reflectionHashCode(this);
// 	}
// 	@Override
// 	public boolean equals(Object obj) {
// 		return EqualsBuilder.reflectionEquals(this, obj);
// 	 } 
// }


import io.microgenie.application.database.EntityDatabusRepository.Key;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapperConfig;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapperConfig.SaveBehavior;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBQueryExpression;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBSaveExpression;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBScanExpression;
import com.amazonaws.services.dynamodbv2.datamodeling.PaginatedQueryList;
import com.amazonaws.services.dynamodbv2.datamodeling.PaginatedScanList;
import com.amazonaws.services.dynamodbv2.model.AttributeValue;
import com.amazonaws.services.dynamodbv2.model.ComparisonOperator;
import com.amazonaws.services.dynamodbv2.model.Condition;
import com.amazonaws.services.dynamodbv2.model.ConditionalOperator;
import com.amazonaws.services.dynamodbv2.model.ExpectedAttributeValue;
import com.google.common.base.Strings;
import com.google.common.collect.Maps;
		List<T> items = this.query(clazz, expression);
		if(items==null){
			return new ArrayList<T>();
		}else{
			return items;
		}
	}
	
	
	
	/***
	 * Get range keys for a given hashKey
	 * @param clazz
	 * @param itemHash
	 * @return rangeKeys
	 */
	public <T> List<T> getRanges(final Class<T> clazz, final T itemHash){
		return this.getRanges(clazz, itemHash, 0, null);		
	}
	
	
	
	/***
	 * Get range keys for a given hashKey
	 * @param clazz
	 * @param itemHash
	 * @return rangeKeys
	 */
	public <T> List<T> getRanges(final Class<T> clazz, final T itemHash, int limit, Map<String, AttributeValue> startKey){
		
// Path: micro-genie-application/src/main/java/io/microgenie/application/database/EntityDatabusRepository.java
// public static class Key{
// 	private String hash;
// 	private String range;
// 	public Key(){}
// 	public Key(final String hash){
// 		this.hash = hash;
// 	}
// 	public Key(final String hash, final String range){
// 		this.hash = hash;
// 		this.range = range;
// 	}
// 	public static Key create(final String hash){
// 		return create(hash, null);
// 	}
// 	public static Key create(final String hash, final String range){
// 		return new Key(hash, range);
// 	}
// 	public String getHash() {
// 		return hash;
// 	}
// 	public void setHash(final String hash) {
// 		this.hash = hash;
// 	}
// 	public String getRange() {
// 		return range;
// 	}
// 	public void setRange(final String range) {
// 		this.range = range;
// 	}
// 	@Override
// 	public int hashCode(){
// 		return HashCodeBuilder.reflectionHashCode(this);
// 	}
// 	@Override
// 	public boolean equals(Object obj) {
// 		return EqualsBuilder.reflectionEquals(this, obj);
// 	 } 
// }


// Path: micro-genie-aws/src/main/java/io/microgenie/aws/dynamodb/DynamoMapperRepository.java
import io.microgenie.application.database.EntityDatabusRepository.Key;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapperConfig;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapperConfig.SaveBehavior;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBQueryExpression;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBSaveExpression;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBScanExpression;
import com.amazonaws.services.dynamodbv2.datamodeling.PaginatedQueryList;
import com.amazonaws.services.dynamodbv2.datamodeling.PaginatedScanList;
import com.amazonaws.services.dynamodbv2.model.AttributeValue;
import com.amazonaws.services.dynamodbv2.model.ComparisonOperator;
import com.amazonaws.services.dynamodbv2.model.Condition;
import com.amazonaws.services.dynamodbv2.model.ConditionalOperator;
import com.amazonaws.services.dynamodbv2.model.ExpectedAttributeValue;
import com.google.common.base.Strings;
import com.google.common.collect.Maps;

		List<T> items = this.query(clazz, expression);
		if(items==null){
			return new ArrayList<T>();
		}else{
			return items;
		}
	}
	
	
	
	/***
	 * Get range keys for a given hashKey
	 * @param clazz
	 * @param itemHash
	 * @return rangeKeys
	 */
	public <T> List<T> getRanges(final Class<T> clazz, final T itemHash){
		return this.getRanges(clazz, itemHash, 0, null);		
	}
	
	
	
	/***
	 * Get range keys for a given hashKey
	 * @param clazz
	 * @param itemHash
	 * @return rangeKeys
	 */
	public <T> List<T> getRanges(final Class<T> clazz, final T itemHash, int limit, Map<String, AttributeValue> startKey){
		
		final Map<String, AttributeValue> starKey = Maps.newHashMap();