protected override bool AddColDefinition(StringBuilder sb, string col, ClassMapping mapping,
string separator, ICollection<string> extraStatements)
{
Type colType = GetDataType(col, mapping);
// Geometry types are special.
if (typeof(IGeometry).IsAssignableFrom(colType))
{
string geomType = "GEOMETRY";
// Specify geometry type if we can.
if (colType == typeof(IPoint))
{
geomType = "POINT";
}
else if (colType == typeof(ILineString))
{
geomType = "LINESTRING";
}
else if (colType == typeof(IPolygon))
{
geomType = "POLYGON";
}
else if (colType == typeof(IMultiPoint))
{
geomType = "MULTIPOINT";
}
else if (colType == typeof(IMultiLineString))
{
geomType = "MULTILINESTRING";
}
else if (colType == typeof(IMultiPolygon))
{
geomType = "MULTIPOLYGON";
}
extraStatements.Add("SELECT AddGeometryColumn('" + mapping.Table +
"', '" + col + "', -1, '" + geomType + "', 2)");
return false;
}
return base.AddColDefinition(sb, col, mapping, separator, extraStatements);
}