Exemple #1
0
        public SchemaManager(SessionManager.Session session)
        {
            if (session == null)
                throw new ArgumentNullException("Session");

            this.session = session;
            this.conn = session.Connection;
            this.tableManager = new TableManager(session);
            this.columnManager = new ColumnManager();
            this.constraintManager = new ConstraintManager();
            this.indexManager = new IndexManager();
        }
 private void purgeConstraintData(TableManager.Table table)
 {
     constraints.RemoveAll((constraint) => (constraint.Table == table));
 }
 public CheckConstraint(
     string owner,
     string tableName,
     TableManager.Table tableRef,
     string constraintName,
     EConstraintStatus? constraintStatus,
     EConstraintDeferrability? deferrableState,
     EConstraintDeferredState? deferredState,
     EConstraintValidation? validationState,
     EConstraintReliability? reliabilityState,
     bool? invalid,
     string searchCondition)
     : base(owner, tableName, constraintName, EConstraintType.Check, constraintStatus,
           deferrableState, deferredState, validationState, reliabilityState, invalid)
 {
     this.searchCondition = searchCondition;
 }
        public bool Refresh(TableManager.Table table)
        {
            OracleCommand cmd = new OracleCommand(ALL_CONSTRAINTS_TABLE_SELECT, conn);
            cmd.BindByName = true;
            // set up parameters
            // schemaParam
            OracleParameter schemaParam = cmd.CreateParameter();
            schemaParam.ParameterName = "owner";
            schemaParam.OracleDbType = OracleDbType.Char;
            schemaParam.Direction = System.Data.ParameterDirection.Input;
            schemaParam.Value = table.Owner;
            cmd.Parameters.Add(schemaParam);
            // tableParam
            OracleParameter tableParam = cmd.CreateParameter();
            tableParam.ParameterName = "table_name";
            tableParam.OracleDbType = OracleDbType.Char;
            tableParam.Direction = System.Data.ParameterDirection.Input;
            tableParam.Value = table.Name;
            cmd.Parameters.Add(tableParam);
            // execute
            OracleDataReader odr = cmd.ExecuteReader();

            if (!odr.HasRows)
                return false;

            // purge old data
            purgeConstraintData(table);

            while (odr.Read())
            {
                ConstraintBase constraint = LoadConstraint(odr);
                constraints.Add(constraint);
            }

            return true;
        }
Exemple #5
0
 private void purgeTableColumnsData(TableManager.Table table)
 {
     columns.RemoveAll((column) => (column.Table == table));
 }
Exemple #6
0
        public bool RefreshColumns(TableManager.Table table)
        {
            // set up command and parameters
            OracleCommand cmd = new OracleCommand(ALL_TAB_COLUMNS_TABLE_SELECT, conn);
            OracleParameter ownerParam = cmd.CreateParameter();
            ownerParam.ParameterName = "owner";
            ownerParam.OracleDbType = OracleDbType.Char;
            ownerParam.Direction = System.Data.ParameterDirection.Input;
            ownerParam.Value = table.Name;
            cmd.Parameters.Add(ownerParam);
            OracleParameter tableParam = cmd.CreateParameter();
            tableParam.ParameterName = "table_name";
            tableParam.OracleDbType = OracleDbType.Char;
            tableParam.Direction = System.Data.ParameterDirection.Input;
            tableParam.Value = table.Owner;
            cmd.Parameters.Add(tableParam);
            // prepare data reader
            OracleDataReader odr = cmd.ExecuteReader();

            if (!odr.HasRows)
                return false;

            // purge table columns data
            purgeTableColumnsData(table);

            while (odr.Read())
            {
                TableColumn column = LoadColumn(odr);
                columns.Add(column);
            }

            return true;
        }
Exemple #7
0
 public Index(
     string owner,
     string tableOwner,
     string tableName,
     TableManager.Table tableRef,
     string indexName,
     EIndexType? indexType,
     EIndexUniqueness? indexUniqueness,
     bool? compression,
     int? prefixLength,
     string tablespaceName,
     EIndexStatus? indexStatus,
     bool? partitioned,
     bool? dropped)
 {
 }
 public bool Refresh(TableManager.Table table)
 {
 }