Azavea.Open.DAO.SQL.SqlDaDdlLayer.CreateStoreRoom C# (CSharp) Method

CreateStoreRoom() public method

Creates the store room specified in the connection descriptor. If this data source doesn't use a store room, this method should be a no-op. If this data source DOES use store rooms, but support for adding them is not implemented yet, this should throw a NotImplementedException. Store room typically corresponds to "table".
public CreateStoreRoom ( ClassMapping mapping ) : void
mapping ClassMapping ClassMapping for the data that will be stored in this room.
return void
        public virtual void CreateStoreRoom(ClassMapping mapping)
        {
            StringBuilder sb = DbCaches.StringBuilders.Get();
            sb.Append("CREATE TABLE ").Append(mapping.Table).Append("(");
            string separator = "";
            IList<string> extraStatements = new List<string>();
            foreach (string col in mapping.AllDataColsInOrder)
            {
                if (AddColDefinition(sb, col, mapping,
                    separator, extraStatements))
                {
                    separator = ",";
                }
            }
            sb.Append(")");
            SqlConnectionUtilities.XSafeCommand(_connDesc, sb.ToString(), null);
            foreach (string statement in extraStatements)
            {
                SqlConnectionUtilities.XSafeCommand(_connDesc, statement, null);
            }
            DbCaches.StringBuilders.Return(sb);
        }