class AbstractDynamoDao extends AbstractDao<M,P,K,I> {

    protected boolean checkUniqueField(String indexName, String field, Object value, K excludeId) {
        Index index = getTable().getIndex(indexName);
        QuerySpec spec = new QuerySpec()
                .withKeyConditionExpression("#field = :value")
                .withNameMap(new NameMap()
                                .with("#field", field)
                )
                .withValueMap(new ValueMap()
                                .with(":value", value)
                );
        Object excludeIdValue = toStorageValue(excludeId);
        for (Item item : index.query(spec)) {
            Object itemId = toStorageValue(item.get(getFieldData().getId().getStorageName()));
            if (!itemId.equals(excludeIdValue)) {
                return false;
            }
        }
        return true;
    }

    public  AbstractDynamoDao(Class<M> modelClass, Class<P> partialClass, AmazonDynamoDB db, String tableName);
    public  AbstractDynamoDao(Class<M> modelClass, Class<P> partialClass, AmazonDynamoDB db, String tableName, ItemMapper<M> modelMapper, ItemMapper<P> partialMapper);

}