class DBUtils {

    public static String getDBTypeForClass(final Class<?> valueType){

        if ( CharSequence.class.isAssignableFrom(valueType) || BigDecimal.class.isAssignableFrom(valueType)) {
            return "TEXT";

        }else if (Long.class.isAssignableFrom(valueType) || Integer.class.isAssignableFrom(valueType) || Short.class.isAssignableFrom(valueType) || Boolean.class.isAssignableFrom(valueType) || Date.class.isAssignableFrom(valueType)) {
            return "INTEGER";

        }else if (Float.class.isAssignableFrom(valueType) || Double.class.isAssignableFrom(valueType)){
            return "REAL";

        }else if (valueType == byte[].class){
            return "BLOB";

        }else{
            throw new IllegalStateException("Type " + valueType + " not supported.");
        }
    }

}