Example #1
0
 public void PrepareTable(Session session)
 {
     if (!this._isResolved)
     {
         if (this.view == null)
         {
             if (this._table == null)
             {
                 QNameManager.QName subqueryTableName = this.database.NameManager.GetSubqueryTableName();
                 this._table = new TableDerived(this.database, subqueryTableName, 2, this.queryExpression, this);
             }
             if (this.IsDataExpression)
             {
                 TableUtil.AddAutoColumns(this._table, this.DataExpression.NodeDataTypes);
                 TableUtil.SetTableIndexesForSubquery(this._table, this._uniqueRows || this._fullOrder, this._uniqueRows);
             }
             else
             {
                 this._table.ColumnList  = this.queryExpression.GetColumns();
                 this._table.ColumnCount = this.queryExpression.GetColumnCount();
                 TableUtil.SetTableIndexesForSubquery(this._table, this._uniqueRows || this._fullOrder, this._uniqueRows);
             }
         }
         else
         {
             TableDerived derived1 = new TableDerived(this.database, this.view.GetName(), 8, this.queryExpression, this)
             {
                 ColumnList = this.view.ColumnList
             };
             this._table             = derived1;
             this._table.ColumnCount = this._table.ColumnList.Size();
             this._table.CreatePrimaryKey();
         }
         this._isResolved = true;
     }
 }