Azavea.Open.DAO.PostgreSQL.PostgreSqlDaLayer.AddColDefinition C# (CSharp) 메소드

AddColDefinition() 보호된 메소드

Add the definition for the given column to the create table statement.
protected AddColDefinition ( StringBuilder sb, string col, ClassMapping mapping, string separator, ICollection extraStatements ) : bool
sb StringBuilder Current create table statement to append to.
col string Name of the column to add a definition for.
mapping ClassMapping Classmapping we're creating a table for.
separator string Separator to use before appending to sb.
extraStatements ICollection If adding this column requires any additional /// SQL statements to be run afterwards, put them here.
리턴 bool
        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);
        }