 		}
 
 		// add calculated properties
-		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.calculatedPropertyList = ListAppend(variables.wheels.class.calculatedPropertyList, local.key);
-				variables.wheels.class.calculatedProperties[local.key] = {};
-				variables.wheels.class.calculatedProperties[local.key][variables.wheels.class.mapping[local.key].type] = variables.wheels.class.mapping[local.key].value;
-				variables.wheels.class.calculatedProperties[local.key].select = variables.wheels.class.mapping[local.key].select;
-				variables.wheels.class.calculatedProperties[local.key].dataType = variables.wheels.class.mapping[local.key].dataType;
+		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.calculatedPropertyList = ListAppend(variables.wheels.class.calculatedPropertyList, loc.key);
+				variables.wheels.class.calculatedProperties[loc.key] = {};
+				variables.wheels.class.calculatedProperties[loc.key][variables.wheels.class.mapping[loc.key].type] = variables.wheels.class.mapping[loc.key].value;
+				variables.wheels.class.calculatedProperties[loc.key].select = variables.wheels.class.mapping[loc.key].select;
+				variables.wheels.class.calculatedProperties[loc.key].dataType = variables.wheels.class.mapping[loc.key].dataType;
 			}
 		}
 

			$updatePersistedProperties();
		}
		variables.wheels.instance.persistedOnInitialization = arguments.persisted;
		return this;
	}

	public struct function $classData() {
		return variables.wheels.class;
	}

	public boolean function $softDeletion() {
		return variables.wheels.class.softDeletion;
	}

	public string function $softDeleteColumn() {
		return variables.wheels.class.softDeleteColumn;
	}
</cfscript>
			variables.wheels.class.adapter = $assignAdapter();

			// get columns for the table
			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(loc.processedColumns, loc.columns["column_name"][loc.i]))
				{
					// default the column to map to a property with the same name
					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
							loc.property = loc.key;
							break;
						}
					}
					loc.type = SpanExcluding(loc.columns["type_name"][loc.i], "( ");

					// set the info we need for each property
					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[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(), 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(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[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[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[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
