Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string objid = Request.QueryString["objid"];
            obj = SchemaManager.GetDatabaseObjectByKey(objid);

            // Make sure it's in MYDB
            // *** TODO: implement security logic and replace this
            if (StringComparer.InvariantCultureIgnoreCase.Compare(obj.DatasetName, MyDBDatabaseDefinition.Name) != 0)
            {
                throw new InvalidOperationException();  // *** TODO
            }

            if (!IsPostBack)
            {
                SchemaName.Text = obj.SchemaName;
                ObjectName.Text = obj.ObjectName;
            }
        }
Beispiel #2
0
        private void InitializeMembers()
        {
            this.node = null;

            this.databaseObject = null;

            this.datasetName = null;
            this.databaseName = null;
            this.schemaName = null;
            this.databaseObjectName = null;
            this.alias = null;

            this.isTableOrView = false;
            this.isUdf = false;
            this.isSubquery = false;
            this.isComputed = false;

            this.columnReferences = new List<ColumnReference>();
            //this.conditionReferences = new List<SearchConditionReference>();

            this.statistics = null;
        }
        private void InitializeMembers()
        {
            this.node = null;

            this.databaseObject = null;

            this.datasetName = null;
            this.databaseName = null;
            this.schemaName = null;
            this.databaseObjectName = null;
            this.systemFunctionName = null;
        }
Beispiel #4
0
 /// <summary>
 /// Constructor that initializes the parent table or view
 /// </summary>
 /// <param name="parent"></param>
 public Column(DatabaseObject parent)
     : base(parent)
 {
     InitializeMembers();
 }
Beispiel #5
0
 /// <summary>
 /// Copies member variable from an existing object
 /// </summary>
 /// <param name="old"></param>
 private void CopyMembers(DatabaseObject old)
 {
     this.cachedVersion = DateTime.Now.Ticks;
     this.objectType = old.objectType;
     this.dataset = old.dataset;
     this.databaseName = old.databaseName;
     this.schemaName = old.schemaName;
     this.objectName = old.objectName;
 }
Beispiel #6
0
 public Parameter(DatabaseObject parent)
     : base(parent)
 {
     InitializeMembers();
 }
Beispiel #7
0
 internal abstract void SaveDatabaseObjectMetadata(DatabaseObject databaseObject);
Beispiel #8
0
 /// <summary>
 /// When overloaded in derived classes, returns the fully resolved name of an object.
 /// </summary>
 /// <remarks>
 /// The fully resolved name uniquely identifies the object
 /// for the underlying server. It uses the same quoting format that what the server
 /// expects.
 /// </remarks>
 public abstract string GetObjectFullyResolvedName(DatabaseObject databaseObject);
Beispiel #9
0
 /// <summary>
 /// When overloaded in derived classes, loads parameters of a function or stored procedure
 /// </summary>
 /// <param name="databaseObject"></param>
 /// <returns></returns>
 internal abstract IEnumerable <KeyValuePair <string, Parameter> > LoadParameters(DatabaseObject databaseObject);
Beispiel #10
0
 internal abstract DatabaseObjectMetadata LoadDatabaseObjectMetadata(DatabaseObject databaseObject);
Beispiel #11
0
 /// <summary>
 /// When overloaded in derived classes, loads all indexes belonging to a table or view
 /// </summary>
 /// <param name="tableOrView"></param>
 /// <returns></returns>
 internal abstract IEnumerable <KeyValuePair <string, Index> > LoadIndexes(DatabaseObject databaseObject);
Beispiel #12
0
 /// <summary>
 /// When overloaded in derived classes, loads all columns of a database object
 /// </summary>
 /// <param name="databaseObject"></param>
 /// <returns></returns>
 internal abstract IEnumerable <KeyValuePair <string, Column> > LoadColumns(DatabaseObject databaseObject);
Beispiel #13
0
 internal abstract bool IsObjectExisting(DatabaseObject databaseObject);
Beispiel #14
0
        public Variable(DatabaseObject parent)
        {
            InitializeMembers();

            this.parent = parent;
        }
Beispiel #15
0
 internal abstract void DropDatabaseObjectMetadata(DatabaseObject databaseObject);
Beispiel #16
0
 private void InitializeMembers()
 {
     this.parent = null;
     this.id = -1;
     this.name = String.Empty;
     this.dataType = null;
     this.metadata = new LazyProperty<VariableMetadata>(LoadMetadata);
 }
Beispiel #17
0
 protected abstract void LoadAllColumnMetadata(DatabaseObject databaseObject);
Beispiel #18
0
        public Variable(DatabaseObject parent)
        {
            InitializeMembers(new StreamingContext());

            this.parent = parent;
        }
Beispiel #19
0
 protected abstract void LoadAllParameterMetadata(DatabaseObject databaseObject);
Beispiel #20
0
        /// <summary>
        /// Copies member variable from an existing object
        /// </summary>
        /// <param name="old"></param>
        private void CopyMembers(DatabaseObject old)
        {
            this.cachedVersion = DateTime.Now.Ticks;
            this.objectType = old.objectType;
            this.dataset = old.dataset;
            this.databaseName = old.databaseName;
            this.schemaName = old.schemaName;
            this.objectName = old.objectName;

            this.metadata = new LazyProperty<DatabaseObjectMetadata>(LoadMetadata);
        }
Beispiel #21
0
 internal abstract void DropAllVariableMetadata(DatabaseObject databaseObject);
Beispiel #22
0
 /// <summary>
 /// Creates a copy of the database object
 /// </summary>
 /// <param name="old"></param>
 protected DatabaseObject(DatabaseObject old)
 {
     CopyMembers(old);
 }
Beispiel #23
0
 /// <summary>
 /// When overloaded in derived classes, renames an object.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="obj"></param>
 /// <param name="newName"></param>
 /// <remarks>
 /// Only works with mutable datasets, ie. myDBs
 /// </remarks>
 internal abstract void RenameObject(DatabaseObject obj, string name);
Beispiel #24
0
 /// <summary>
 /// Creates a copy of the database object
 /// </summary>
 /// <param name="old"></param>
 protected DatabaseObject(DatabaseObject old)
 {
     CopyMembers(old);
 }
Beispiel #25
0
 /// <summary>
 /// When overloaded in derived classes, drops an object.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="obj"></param>
 /// <remarks>
 /// Only works with mutable datasets, ie. myDBs
 /// </remarks>
 internal abstract void DropObject(DatabaseObject obj);
        private void CopyMembers(FunctionReference old)
        {
            this.node = old.node;

            this.databaseObject = old.databaseObject;

            this.datasetName = old.datasetName;
            this.databaseName = old.databaseName;
            this.schemaName = old.schemaName;
            this.databaseObjectName = old.databaseObjectName;
            this.systemFunctionName = old.systemFunctionName;
        }
 private string QuoteDatabaseObjectName(DatabaseObject dbobject)
 {
     return QuoteIdentifier(dbobject.ObjectName);
 }
Beispiel #28
0
        private void CopyMembers(TableReference old)
        {
            this.node = old.node;

            this.databaseObject = old.databaseObject;

            this.datasetName = old.datasetName;
            this.databaseName = old.databaseName;
            this.schemaName = old.schemaName;
            this.databaseObjectName = old.databaseObjectName;
            this.alias = old.alias;

            this.isTableOrView = old.isTableOrView;
            this.isUdf = old.isUdf;
            this.isSubquery = old.isSubquery;
            this.isComputed = old.isComputed;

            // Deep copy of column references
            this.columnReferences = new List<ColumnReference>();
            foreach (var cr in old.columnReferences)
            {
                var ncr = new ColumnReference(cr)
                {
                    TableReference = this
                };
                this.columnReferences.Add(ncr);
            }
            //this.conditionReferences = new List<SearchConditionReference>(old.conditionReferences);

            this.statistics = old.statistics == null ? null : new TableStatistics(old.statistics);
        }
Beispiel #29
0
 public Parameter(DatabaseObject parent)
     : base(parent)
 {
     InitializeMembers();
 }
Beispiel #30
0
 /// <summary>
 /// Constructor that initializes the parent table or view
 /// </summary>
 /// <param name="parent"></param>
 public Column(DatabaseObject parent)
     : base(parent)
 {
     InitializeMembers();
 }
        private void CopyMembers(DatabaseObjectReference old)
        {
            this.node = old.node;

            this.databaseObject = old.databaseObject;

            this.datasetName = old.datasetName;
            this.databaseName = old.databaseName;
            this.schemaName = old.schemaName;
            this.databaseObjectName = old.databaseObjectName;
        }
Beispiel #32
0
 private void CopyMembers(Variable old)
 {
     this.parent = old.parent;
     this.id = old.id;
     this.name = old.name;
     this.dataType = old.dataType;
     this.metadata = new LazyProperty<VariableMetadata>(LoadMetadata);
 }
 public string GetResolvedTableName(DatabaseObject table)
 {
     return GetResolvedTableName(table.DatabaseName, table.SchemaName, table.ObjectName);
 }
Beispiel #34
0
        public Variable(DatabaseObject parent)
        {
            InitializeMembers(new StreamingContext());

            this.parent = parent;
        }
        private string QuoteDatabaseObjectName(DatabaseObject dbobject)
        {
            string res = String.Empty;

            return QuoteIdentifier(dbobject.ObjectName);
        }