// Path: CPOrm/src/main/java/za/co/cporm/model/map/SqlColumnMapping.java
// public interface SqlColumnMapping {
// 
//     /** The java type this mapping will represent */
//     Class<?> getJavaType();
// 
//     /** The SQL equivalent column name that will be used to store this type */
//     String getSqlColumnTypeName();
// 
//     /** Converts the source object to the correct representation to be stored in the sql database.
//      *  For example, a Date might be stored as a millisecond long, this will convert the date object to milliseconds.
//      */
//     Object toSqlType(Object source);
// 
//     /** Gets the appropriate column value from the column in the cursor, it will then
//      *  convert that to the correct java type.
//      *  For example, a Date might be stored as a millisecond long, this will take the long, and a create a new Data object.
//      */
//     Object getColumnValue(Cursor cursor, int columnIndex);
// 
//     /**
//      * This will convert and set the correct object type for supplied value.
//      * An explanation for the conversion can be found on toSqlType(Object source);
//      * @param contentValues The content values that the object will be placed in
//      * @param key The key that the object should placed into
//      * @param value The source object to be converted
//      */
//     void setColumnValue(ContentValues contentValues, String key, Object value);
// 
//     void setBundleValue(Bundle bundle, String key, Cursor cursor, int columnIndex);
// 
//     Object getColumnValue(Bundle bundle, String columnName);
// }
// 
// Path: CPOrm/src/main/java/za/co/cporm/model/naming/ColumnNameConverter.java
// public interface ColumnNameConverter {
// 
//     String convertToSql(String fieldName);
// }
// 
// Path: CPOrm/src/main/java/za/co/cporm/model/util/DefaultColumnNameConverter.java
// public class DefaultColumnNameConverter implements ColumnNameConverter {
// 
//     /**
//      * Converts the source string to a SQL compatible string.  It does this
//      * by checking for camelcase values, and applying a underscore '_' to whenever one is found.  All
//      * characters are also converted to lower case.
//      *
//      * Example: If the provided string is "helloWorld" the resulting string will be "hello_world"
//      * @param original String to converted
//      * @return the converted string
//      */
//     public static String getSQLName(String original){
// 
//         StringBuilder sqlName = new StringBuilder();
// 
//         for (char character : original.toCharArray()) {
// 
//             if(Character.isUpperCase(character) && sqlName.length() > 0) sqlName.append("_");
// 
//             sqlName.append(Character.toLowerCase(character));
//         }
// 
//         return sqlName.toString();
//     }
// 
//     /**
//      * Converts the source string to a SQL compatible string.  It does this
//      * by checking for camelcase values, and applying a underscore '_' to whenever one is found.  All
//      * characters are also converted to lower case.
//      *
//      * Example: If the provided string is "helloWorld" the resulting string will be "hello_world"
//      * @param fieldName String to convert
//      * @return the converted string
//      */
//     @Override
//     public String convertToSql(String fieldName) {
//         StringBuilder sqlName = new StringBuilder();
// 
//         for (char character : fieldName.toCharArray()) {
// 
//             if(Character.isUpperCase(character) && sqlName.length() > 0) sqlName.append("_");
// 
//             sqlName.append(Character.toLowerCase(character));
//         }
// 
//         return sqlName.toString();
//     }
// }


import android.content.ContentValues;
import android.database.Cursor;
import android.os.Bundle;
import android.text.TextUtils;
import za.co.cporm.model.annotation.Index;
import za.co.cporm.model.annotation.TableConstraint;
import za.co.cporm.model.map.SqlColumnMapping;
import za.co.cporm.model.naming.ColumnNameConverter;
import za.co.cporm.model.util.DefaultColumnNameConverter;
import java.io.Serializable;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.util.*;

        boolean hasPrimaryKey = false;

        for (ColumnDetails columnDetails : columns) {
            if(hasPrimaryKey && columnDetails.isPrimaryKey()) throw new IllegalStateException("Table may only have one primary key constraint on column definition, is a table constraints to specify more than one");

            hasPrimaryKey = hasPrimaryKey || columnDetails.isPrimaryKey();
        }
    }

    public List<Index> getIndices() {
        return Collections.unmodifiableList(indices);
    }

    public void addIndex(Index index) {
        indices.add(index);
    }

    public List<Class<?>> getChangeListeners() {
        return Collections.unmodifiableList(changeListener);
    }

    public void addChangeListener(Class<?> clazz) {
        changeListener.add(clazz);
    }

    public Collection<TableConstraint> getConstraints() {
        return constraints;
    }

// Path: CPOrm/src/main/java/za/co/cporm/model/map/SqlColumnMapping.java
// public interface SqlColumnMapping {
// 
//     /** The java type this mapping will represent */
//     Class<?> getJavaType();
// 
//     /** The SQL equivalent column name that will be used to store this type */
//     String getSqlColumnTypeName();
// 
//     /** Converts the source object to the correct representation to be stored in the sql database.
//      *  For example, a Date might be stored as a millisecond long, this will convert the date object to milliseconds.
//      */
//     Object toSqlType(Object source);
// 
//     /** Gets the appropriate column value from the column in the cursor, it will then
//      *  convert that to the correct java type.
//      *  For example, a Date might be stored as a millisecond long, this will take the long, and a create a new Data object.
//      */
//     Object getColumnValue(Cursor cursor, int columnIndex);
// 
//     /**
//      * This will convert and set the correct object type for supplied value.
//      * An explanation for the conversion can be found on toSqlType(Object source);
//      * @param contentValues The content values that the object will be placed in
//      * @param key The key that the object should placed into
//      * @param value The source object to be converted
//      */
//     void setColumnValue(ContentValues contentValues, String key, Object value);
// 
//     void setBundleValue(Bundle bundle, String key, Cursor cursor, int columnIndex);
// 
//     Object getColumnValue(Bundle bundle, String columnName);
// }
// 
// Path: CPOrm/src/main/java/za/co/cporm/model/naming/ColumnNameConverter.java
// public interface ColumnNameConverter {
// 
//     String convertToSql(String fieldName);
// }
// 
// Path: CPOrm/src/main/java/za/co/cporm/model/util/DefaultColumnNameConverter.java
// public class DefaultColumnNameConverter implements ColumnNameConverter {
// 
//     /**
//      * Converts the source string to a SQL compatible string.  It does this
//      * by checking for camelcase values, and applying a underscore '_' to whenever one is found.  All
//      * characters are also converted to lower case.
//      *
//      * Example: If the provided string is "helloWorld" the resulting string will be "hello_world"
//      * @param original String to converted
//      * @return the converted string
//      */
//     public static String getSQLName(String original){
// 
//         StringBuilder sqlName = new StringBuilder();
// 
//         for (char character : original.toCharArray()) {
// 
//             if(Character.isUpperCase(character) && sqlName.length() > 0) sqlName.append("_");
// 
//             sqlName.append(Character.toLowerCase(character));
//         }
// 
//         return sqlName.toString();
//     }
// 
//     /**
//      * Converts the source string to a SQL compatible string.  It does this
//      * by checking for camelcase values, and applying a underscore '_' to whenever one is found.  All
//      * characters are also converted to lower case.
//      *
//      * Example: If the provided string is "helloWorld" the resulting string will be "hello_world"
//      * @param fieldName String to convert
//      * @return the converted string
//      */
//     @Override
//     public String convertToSql(String fieldName) {
//         StringBuilder sqlName = new StringBuilder();
// 
//         for (char character : fieldName.toCharArray()) {
// 
//             if(Character.isUpperCase(character) && sqlName.length() > 0) sqlName.append("_");
// 
//             sqlName.append(Character.toLowerCase(character));
//         }
// 
//         return sqlName.toString();
//     }
// }


// Path: CPOrm/src/main/java/za/co/cporm/model/generate/TableDetails.java
import android.content.ContentValues;
import android.database.Cursor;
import android.os.Bundle;
import android.text.TextUtils;
import za.co.cporm.model.annotation.Index;
import za.co.cporm.model.annotation.TableConstraint;
import za.co.cporm.model.map.SqlColumnMapping;
import za.co.cporm.model.naming.ColumnNameConverter;
import za.co.cporm.model.util.DefaultColumnNameConverter;
import java.io.Serializable;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.util.*;


        boolean hasPrimaryKey = false;

        for (ColumnDetails columnDetails : columns) {
            if(hasPrimaryKey && columnDetails.isPrimaryKey()) throw new IllegalStateException("Table may only have one primary key constraint on column definition, is a table constraints to specify more than one");

            hasPrimaryKey = hasPrimaryKey || columnDetails.isPrimaryKey();
        }
    }

    public List<Index> getIndices() {
        return Collections.unmodifiableList(indices);
    }

    public void addIndex(Index index) {
        indices.add(index);
    }

    public List<Class<?>> getChangeListeners() {
        return Collections.unmodifiableList(changeListener);
    }

    public void addChangeListener(Class<?> clazz) {
        changeListener.add(clazz);
    }

    public Collection<TableConstraint> getConstraints() {
        return constraints;
    }

    public void addConstraint(TableConstraint contConstraint){