 			variables.wheels.class.adapter = $assignAdapter();
 
 			// get columns for the table
-			local.columns = variables.wheels.class.adapter.$getColumns(tableName());
-
-			local.processedColumns = "";
-			local.iEnd = local.columns.recordCount;
-			for (local.i=1; local.i <= local.iEnd; local.i++)
+			loc.columns = variables.wheels.class.adapter.$getColumns(tableName());
+
+			loc.processedColumns = "";
+			loc.iEnd = loc.columns.recordCount;
+			for (loc.i=1; loc.i <= loc.iEnd; loc.i++)
 			{
 				// set up properties and column mapping
-				if (!ListFind(local.processedColumns, local.columns["column_name"][local.i]))
+				if (!ListFind(loc.processedColumns, loc.columns["column_name"][loc.i]))
 				{
 					// default the column to map to a property with the same name
-					local.property = local.columns["column_name"][local.i];
-					for (local.key in variables.wheels.class.mapping)
-					{
-						if (StructKeyExists(variables.wheels.class.mapping[local.key], "type") && variables.wheels.class.mapping[local.key].type == "column" && variables.wheels.class.mapping[local.key].value == local.property)
+					loc.property = loc.columns["column_name"][loc.i];
+					for (loc.key in variables.wheels.class.mapping)
+					{
+						if (StructKeyExists(variables.wheels.class.mapping[loc.key], "type") && variables.wheels.class.mapping[loc.key].type == "column" && variables.wheels.class.mapping[loc.key].value == loc.property)
 						{
 							// developer has chosen to map this column to a property with a different name so set that here
-							local.property = local.key;
+							loc.property = loc.key;
 							break;
 						}
 					}
-					local.type = SpanExcluding(local.columns["type_name"][local.i], "( ");
+					loc.type = SpanExcluding(loc.columns["type_name"][loc.i], "( ");
 
 					// set the info we need for each property
-					variables.wheels.class.properties[local.property] = {};
-					variables.wheels.class.properties[local.property].dataType = local.type;
-					variables.wheels.class.properties[local.property].type = variables.wheels.class.adapter.$getType(local.type, local.columns["decimal_digits"][local.i]);
-					variables.wheels.class.properties[local.property].column = local.columns["column_name"][local.i];
-					variables.wheels.class.properties[local.property].scale = local.columns["decimal_digits"][local.i];
+					variables.wheels.class.properties[loc.property] = {};
+					variables.wheels.class.properties[loc.property].dataType = loc.type;
+					variables.wheels.class.properties[loc.property].type = variables.wheels.class.adapter.$getType(loc.type, loc.columns["decimal_digits"][loc.i]);
+					variables.wheels.class.properties[loc.property].column = loc.columns["column_name"][loc.i];
+					variables.wheels.class.properties[loc.property].scale = loc.columns["decimal_digits"][loc.i];
 
 					// get a boolean value for whether this column can be set to null or not
 					// if we don't get a boolean back we try to translate y/n to proper boolean values in cfml (yes/no)
-					variables.wheels.class.properties[local.property].nullable = Trim(local.columns["is_nullable"][local.i]);
-					if (!IsBoolean(variables.wheels.class.properties[local.property].nullable))
-					{
-						variables.wheels.class.properties[local.property].nullable = ReplaceList(variables.wheels.class.properties[local.property].nullable, "N,Y", "No,Yes");
-					}
-
-					variables.wheels.class.properties[local.property].size = local.columns["column_size"][local.i];
-					variables.wheels.class.properties[local.property].label = Humanize(local.property);
-					variables.wheels.class.properties[local.property].validationtype = variables.wheels.class.adapter.$getValidationType(variables.wheels.class.properties[local.property].type);
-					if (StructKeyExists(variables.wheels.class.mapping, local.property))
-					{
-						if (StructKeyExists(variables.wheels.class.mapping[local.property], "label"))
-						{
-							variables.wheels.class.properties[local.property].label = variables.wheels.class.mapping[local.property].label;
-						}
-						if (StructKeyExists(variables.wheels.class.mapping[local.property], "defaultValue"))
-						{
-							variables.wheels.class.properties[local.property].defaultValue = variables.wheels.class.mapping[local.property].defaultValue;
-						}
-					}
-					if (local.columns["is_primarykey"][local.i])
-					{
-						setPrimaryKey(local.property);
-					}
-					if (variables.wheels.class.automaticValidations && !ListFindNoCase("#application.wheels.timeStampOnCreateProperty#,#application.wheels.timeStampOnUpdateProperty#,#application.wheels.softDeleteProperty#", local.property))
-					{
-						local.defaultValidationsAllowBlank = variables.wheels.class.properties[local.property].nullable;
+					variables.wheels.class.properties[loc.property].nullable = Trim(loc.columns["is_nullable"][loc.i]);
+					if (!IsBoolean(variables.wheels.class.properties[loc.property].nullable))
+					{
+						variables.wheels.class.properties[loc.property].nullable = ReplaceList(variables.wheels.class.properties[loc.property].nullable, "N,Y", "No,Yes");
+					}
+
+					variables.wheels.class.properties[loc.property].size = loc.columns["column_size"][loc.i];
+					variables.wheels.class.properties[loc.property].label = Humanize(loc.property);
+					variables.wheels.class.properties[loc.property].validationtype = variables.wheels.class.adapter.$getValidationType(variables.wheels.class.properties[loc.property].type);
+					if (StructKeyExists(variables.wheels.class.mapping, loc.property))
+					{
+						if (StructKeyExists(variables.wheels.class.mapping[loc.property], "label"))
+						{
+							variables.wheels.class.properties[loc.property].label = variables.wheels.class.mapping[loc.property].label;
+						}
+						if (StructKeyExists(variables.wheels.class.mapping[loc.property], "defaultValue"))
+						{
+							variables.wheels.class.properties[loc.property].defaultValue = variables.wheels.class.mapping[loc.property].defaultValue;
+						}
+					}
+					if (loc.columns["is_primarykey"][loc.i])
+					{
+						setPrimaryKey(loc.property);
+					}
+					if (variables.wheels.class.automaticValidations && !ListFindNoCase("#application.wheels.timeStampOnCreateProperty#,#application.wheels.timeStampOnUpdateProperty#,#application.wheels.softDeleteProperty#", loc.property))
+					{
+						loc.defaultValidationsAllowBlank = variables.wheels.class.properties[loc.property].nullable;
 
 						// primary keys should be allowed to be blank
-						if (ListFindNoCase(primaryKeys(), local.property))
-						{
-							local.defaultValidationsAllowBlank = true;
-						}
-						if (!ListFindNoCase(primaryKeys(), local.property) && !variables.wheels.class.properties[local.property].nullable && !Len(local.columns["column_default_value"][local.i]) && !$validationExists(property=local.property, validation="validatesPresenceOf"))
-						{
-							validatesPresenceOf(properties=local.property);
+						if (ListFindNoCase(primaryKeys(), loc.property))
+						{
+							loc.defaultValidationsAllowBlank = true;
+						}
+						if (!ListFindNoCase(primaryKeys(), loc.property) && !variables.wheels.class.properties[loc.property].nullable && !Len(loc.columns["column_default_value"][loc.i]) && !$validationExists(property=loc.property, validation="validatesPresenceOf"))
+						{
+							validatesPresenceOf(properties=loc.property);
 						}
 
 						// always allowblank if a database default or validatesPresenceOf() has been set
-						if (Len(local.columns["column_default_value"][local.i]) || $validationExists(property=local.property, validation="validatesPresenceOf"))
-						{
-							local.defaultValidationsAllowBlank = true;
+						if (Len(loc.columns["column_default_value"][loc.i]) || $validationExists(property=loc.property, validation="validatesPresenceOf"))
+						{
+							loc.defaultValidationsAllowBlank = true;
 						}
 
 						// set length validations if the developer has not
-						if (variables.wheels.class.properties[local.property].validationtype == "string" && !$validationExists(property=local.property, validation="validatesLengthOf"))
-						{
-							validatesLengthOf(properties=local.property, allowBlank=local.defaultValidationsAllowBlank, maximum=variables.wheels.class.properties[local.property].size);
+						if (variables.wheels.class.properties[loc.property].validationtype == "string" && !$validationExists(property=loc.property, validation="validatesLengthOf"))
+						{
+							validatesLengthOf(properties=loc.property, allowBlank=loc.defaultValidationsAllowBlank, maximum=variables.wheels.class.properties[loc.property].size);
 						}
 
 						// set numericality validations if the developer has not
-						if (ListFindNoCase("integer,float", variables.wheels.class.properties[local.property].validationtype) && !$validationExists(property=local.property, validation="validatesNumericalityOf"))
-						{
-							validatesNumericalityOf(properties=local.property, allowBlank=local.defaultValidationsAllowBlank, onlyInteger=(variables.wheels.class.properties[local.property].validationtype == "integer"));
+						if (ListFindNoCase("integer,float", variables.wheels.class.properties[loc.property].validationtype) && !$validationExists(property=loc.property, validation="validatesNumericalityOf"))
+						{
+							validatesNumericalityOf(properties=loc.property, allowBlank=loc.defaultValidationsAllowBlank, onlyInteger=(variables.wheels.class.properties[loc.property].validationtype == "integer"));
 						}
 
 						// set date validations if the developer has not (checks both dates or times as per the IsDate() function)
-						if (variables.wheels.class.properties[local.property].validationtype == "datetime" && !$validationExists(property=local.property, validation="validatesFormatOf"))
-						{
-							validatesFormatOf(properties=local.property, allowBlank=local.defaultValidationsAllowBlank, type="date");
-						}
-					}
-					variables.wheels.class.propertyList = ListAppend(variables.wheels.class.propertyList, local.property);
-					variables.wheels.class.columnList = ListAppend(variables.wheels.class.columnList, variables.wheels.class.properties[local.property].column);
-					local.processedColumns = ListAppend(local.processedColumns, local.columns["column_name"][local.i]);
+						if (variables.wheels.class.properties[loc.property].validationtype == "datetime" && !$validationExists(property=loc.property, validation="validatesFormatOf"))
+						{
+							validatesFormatOf(properties=loc.property, allowBlank=loc.defaultValidationsAllowBlank, type="date");
+						}
+					}
+					variables.wheels.class.propertyList = ListAppend(variables.wheels.class.propertyList, loc.property);
+					variables.wheels.class.columnList = ListAppend(variables.wheels.class.columnList, variables.wheels.class.properties[loc.property].column);
+					loc.processedColumns = ListAppend(loc.processedColumns, loc.columns["column_name"][loc.i]);
 				}
 			}
 			// raise error when no primary key has been defined for the table

		}
		else
		{
			local.info = $dbinfo(dataSource=variables.wheels.class.dataSource, username=variables.wheels.class.username, password=variables.wheels.class.password, type="version");
		}
		if (FindNoCase("SQLServer", local.info.driver_name) || FindNoCase("SQL Server", local.info.driver_name))
		{
			local.adapterName = "SQLServer";
		}
		else if (FindNoCase("MySQL", local.info.driver_name))
		{
			local.adapterName = "MySQL";
		}
		else if (FindNoCase("Oracle", local.info.driver_name))
		{
			local.adapterName = "Oracle";
		}
		else if (FindNoCase("PostgreSQL", local.info.driver_name))
		{
			local.adapterName = "PostgreSQL";
		}
		else if (FindNoCase("H2", local.info.driver_name))
		{
			local.adapterName = "H2";
		}
		else
		{
			$throw(type="Wheels.DatabaseNotSupported", message="#local.info.database_productname# is not supported by CFWheels.", extendedInfo="Use SQL Server, MySQL, Oracle, PostgreSQL or H2.");
		}
		local.rv = CreateObject("component", "adapters.#local.adapterName#").init(dataSource=variables.wheels.class.dataSource, username=variables.wheels.class.username, password=variables.wheels.class.password);
		application.wheels.adapterName = local.adapterName;
		return local.rv;
	}

	public any function $initModelObject(
		required string name,
		required any properties,
		required boolean persisted,
		numeric row="1",
		boolean base="true",
		boolean useFilterLists="true"
	) {
		variables.wheels = {};
		variables.wheels.instance = {};
		variables.wheels.errors = [];

<!--- PRIVATE METHODS --->

<cffunction name="$initModelClass" returntype="any" access="public" output="false">
	<cfargument name="name" type="string" required="true">
	<cfargument name="path" type="string" required="true">
	<cfscript>
		var loc = {};
		variables.wheels = {};
		variables.wheels.errors = [];
		variables.wheels.class = {};
