private AttributeMap GetAttributeMapInformation(XmlReader reader, ClassMap clsMap, TableMap tblMap, int colIndex) { // <attribute name="Class_ID" column="Class_ID" type="String" key="primary" size="20" /> string attrName = reader.GetAttribute("name"); string attrColumn = reader.GetAttribute("column"); string dataType = reader.GetAttribute("type"); string attrKey = reader.GetAttribute("key"); string autoIncrement = reader.GetAttribute("increment"); string timestamp = reader.GetAttribute("timestamp"); string autoValue = reader.GetAttribute("auto"); int size = Convert.ToInt32(reader.GetAttribute("size")); AttributeMap attrMap = null; if (attrName != null) { ColumnMap colMap = null; attrMap = new AttributeMap(attrName); if (attrColumn != null) { colMap = new ColumnMap(clsMap.PersistenceProvider.GetName(attrColumn), tblMap); if (attrKey != null) { if (attrKey.ToUpper() == "PRIMARY") { colMap.KeyType = ColumnKeyTypes.PrimaryKey; } } Assert.VerifyNotNull(dataType, Error.XmlReadError, "Column " + colMap.GetFullyQualifiedName() + " Unknown data type used!"); switch (dataType.ToLower()) { #region case "boolean": colMap.Type = DbType.Boolean; attrMap.SqlValueStringType = clsMap.PersistenceProvider.SqlValueType(DbType.Boolean); break; case "bigint": colMap.Type = DbType.Int64; break; case "binary": colMap.Type = DbType.Binary; attrMap.SqlValueStringType = SqlValueTypes.NotSupport; break; case "currency": colMap.Type = DbType.Currency; break; case "date": colMap.Type = DbType.DateTime; attrMap.SqlValueStringType = SqlValueTypes.SimpleQuotesString; break; case "dbdate": colMap.Type = DbType.Date; attrMap.SqlValueStringType = SqlValueTypes.SimpleQuotesString; break; case "decimal": colMap.Type = DbType.Decimal; break; case "double": colMap.Type = DbType.Double; break; case "guid": colMap.Type = DbType.Guid; attrMap.SqlValueStringType = SqlValueTypes.SimpleQuotesString; break; case "object": colMap.Type = DbType.Object; attrMap.SqlValueStringType = SqlValueTypes.NotSupport; break; case "single": colMap.Type = DbType.Single; break; case "smallint": colMap.Type = DbType.Int16; break; case "tinyint": colMap.Type = DbType.SByte; break; case "long": colMap.Type = DbType.Int64; break; case "integer": colMap.Type = DbType.Int32; break; case "varchar": colMap.Type = DbType.String; attrMap.SqlValueStringType = SqlValueTypes.String; break; case "string": colMap.Type = DbType.String; attrMap.SqlValueStringType = SqlValueTypes.String; break; default: Assert.Fail(Error.NoSupport); break; #endregion } if (autoIncrement != null) { colMap.IsAutoValue = true; tblMap.AutoIdentityIndex = colIndex; clsMap.AutoIdentityAttribute = attrName; } if (timestamp != null) { tblMap.TimestampColumn = attrColumn; tblMap.TimestampParameter = "@" + tblMap.TimestampColumn; clsMap.TimestampAttribute = attrName; colMap.IsAutoValue = true; } if (autoValue != null) { colMap.IsAutoValue = true; } if (size > 0) { colMap.Size = size; } } attrMap.Column = colMap; } return(attrMap); }