// Path: CPOrm/src/main/java/za/co/cporm/model/map/SqlColumnMappingFactory.java
// public class SqlColumnMappingFactory {
// 
//     private final List<SqlColumnMapping> columnMappings;
// 
//     public SqlColumnMappingFactory(){
// 
//         columnMappings = new ArrayList<SqlColumnMapping>();
//         columnMappings.add(new BooleanType());
//         columnMappings.add(new CalendarType());
//         columnMappings.add(new DateType());
//         columnMappings.add(new DoubleType());
//         columnMappings.add(new FloatType());
//         columnMappings.add(new IntegerType());
//         columnMappings.add(new LongType());
//         columnMappings.add(new ShortType());
//         columnMappings.add(new StringType());
//         columnMappings.add(new UUIDType());
//         columnMappings.add(new ByteArray());
//     }
// 
//     public SqlColumnMapping findColumnMapping(Field field){
//         return findColumnMapping(field.getType());
//     }
// 
//     public SqlColumnMapping findColumnMapping(Class<?> fieldType){
// 
// 
//         for (SqlColumnMapping columnMapping : columnMappings) {
// 
//             Class<?> fieldTypeWrapped = wrapPrimitives(fieldType);
//             Class<?> columnType = columnMapping.getJavaType();
//             if(columnType.equals(fieldTypeWrapped) || columnType.isAssignableFrom(fieldType))
//                 return columnMapping;
//         }
// 
//         if(fieldType.isArray()){
//             for (SqlColumnMapping columnMapping : columnMappings) {
//                 if(!columnMapping.getJavaType().isArray())
//                     continue;
// 
//                 Class<?> columnType = columnMapping.getJavaType().getComponentType();
//                 Class<?> fieldComponent = fieldType.getComponentType();
//                 Class<?> fieldTypeWrapped = wrapPrimitives(fieldComponent);
//                 if(columnType.equals(fieldTypeWrapped) || columnType.isAssignableFrom(fieldComponent))
//                     return columnMapping;
//             }
//         }
// 
//         throw new IllegalArgumentException("No valid SQL mapping found for type " + fieldType);
//     }
// 
//     private Class<?> wrapPrimitives(Class fieldType){
// 
//         if(!fieldType.isPrimitive()) return fieldType;
// 
//         if(long.class.equals(fieldType)) return Long.class;
//         if(int.class.equals(fieldType)) return Integer.class;
//         if(double.class.equals(fieldType)) return Double.class;
//         if(float.class.equals(fieldType)) return Float.class;
//         if(short.class.equals(fieldType)) return Short.class;
//         if(boolean.class.equals(fieldType)) return Boolean.class;
//         if(byte.class.equals(fieldType)) return Byte.class;
//         if(void.class.equals(fieldType)) return Void.class;
//         if(char.class.equals(fieldType)) return Character.class;
// 
//         throw new IllegalArgumentException("No primitive type registered for type " + fieldType);
//     }
// }


import android.content.Context;
import android.text.TextUtils;
import za.co.cporm.model.map.SqlColumnMappingFactory;
import java.util.Collection;
import java.util.Iterator;
                builder.append(")");
            }
            else builder.append(" ?");
        }

        return builder;
    }

    @Override
    public DataFilterCriterion cloneFrom() {

        DataFilterCriterion clone = new DataFilterCriterion();
        clone.filterColumn = String.valueOf(this.filterColumn);
        clone.filterOperator = this.filterOperator;
        clone.filterValue = this.filterValue;

        return clone;
    }

    @Override
    public boolean hasFilterValue() {

        return filterColumn != null && filterOperator != null;
    }

    @Override
    public DataFilterCriterion addClause(DataFilterClause clause, DataFilterConjunction conjunction) {
        throw new UnsupportedOperationException("Clauses cannot be added to a data filter criterion");
    }

// Path: CPOrm/src/main/java/za/co/cporm/model/map/SqlColumnMappingFactory.java
// public class SqlColumnMappingFactory {
// 
//     private final List<SqlColumnMapping> columnMappings;
// 
//     public SqlColumnMappingFactory(){
// 
//         columnMappings = new ArrayList<SqlColumnMapping>();
//         columnMappings.add(new BooleanType());
//         columnMappings.add(new CalendarType());
//         columnMappings.add(new DateType());
//         columnMappings.add(new DoubleType());
//         columnMappings.add(new FloatType());
//         columnMappings.add(new IntegerType());
//         columnMappings.add(new LongType());
//         columnMappings.add(new ShortType());
//         columnMappings.add(new StringType());
//         columnMappings.add(new UUIDType());
//         columnMappings.add(new ByteArray());
//     }
// 
//     public SqlColumnMapping findColumnMapping(Field field){
//         return findColumnMapping(field.getType());
//     }
// 
//     public SqlColumnMapping findColumnMapping(Class<?> fieldType){
// 
// 
//         for (SqlColumnMapping columnMapping : columnMappings) {
// 
//             Class<?> fieldTypeWrapped = wrapPrimitives(fieldType);
//             Class<?> columnType = columnMapping.getJavaType();
//             if(columnType.equals(fieldTypeWrapped) || columnType.isAssignableFrom(fieldType))
//                 return columnMapping;
//         }
// 
//         if(fieldType.isArray()){
//             for (SqlColumnMapping columnMapping : columnMappings) {
//                 if(!columnMapping.getJavaType().isArray())
//                     continue;
// 
//                 Class<?> columnType = columnMapping.getJavaType().getComponentType();
//                 Class<?> fieldComponent = fieldType.getComponentType();
//                 Class<?> fieldTypeWrapped = wrapPrimitives(fieldComponent);
//                 if(columnType.equals(fieldTypeWrapped) || columnType.isAssignableFrom(fieldComponent))
//                     return columnMapping;
//             }
//         }
// 
//         throw new IllegalArgumentException("No valid SQL mapping found for type " + fieldType);
//     }
// 
//     private Class<?> wrapPrimitives(Class fieldType){
// 
//         if(!fieldType.isPrimitive()) return fieldType;
// 
//         if(long.class.equals(fieldType)) return Long.class;
//         if(int.class.equals(fieldType)) return Integer.class;
//         if(double.class.equals(fieldType)) return Double.class;
//         if(float.class.equals(fieldType)) return Float.class;
//         if(short.class.equals(fieldType)) return Short.class;
//         if(boolean.class.equals(fieldType)) return Boolean.class;
//         if(byte.class.equals(fieldType)) return Byte.class;
//         if(void.class.equals(fieldType)) return Void.class;
//         if(char.class.equals(fieldType)) return Character.class;
// 
//         throw new IllegalArgumentException("No primitive type registered for type " + fieldType);
//     }
// }


// Path: CPOrm/src/main/java/za/co/cporm/model/query/DataFilterCriterion.java
import android.content.Context;
import android.text.TextUtils;
import za.co.cporm.model.map.SqlColumnMappingFactory;
import java.util.Collection;
import java.util.Iterator;

                builder.append(")");
            }
            else builder.append(" ?");
        }

        return builder;
    }

    @Override
    public DataFilterCriterion cloneFrom() {

        DataFilterCriterion clone = new DataFilterCriterion();
        clone.filterColumn = String.valueOf(this.filterColumn);
        clone.filterOperator = this.filterOperator;
        clone.filterValue = this.filterValue;

        return clone;
    }

    @Override
    public boolean hasFilterValue() {

        return filterColumn != null && filterOperator != null;
    }

    @Override
    public DataFilterCriterion addClause(DataFilterClause clause, DataFilterConjunction conjunction) {
        throw new UnsupportedOperationException("Clauses cannot be added to a data filter criterion");
    }

    private Object convertToSQLFormat(SqlColumnMappingFactory columnMappingFactory, Object object){