コード例 #1
0
ファイル: TableBase.cs プロジェクト: gunivan/cooq
 private TableBase(DatabaseBase db, string tableName, Type recordType, bool pIsTemporaryTable, bool?pUseConcurrenyChecking)
 {
     if (db == null)
     {
         throw new NullReferenceException("DefaultDatabase cannot be null");
     }
     if (string.IsNullOrWhiteSpace(tableName))
     {
         throw new Exception("tableName cannot be null or empty");
     }
     if (recordType == (Type)null)
     {
         throw new NullReferenceException("recordType cannot be null");
     }
     if (!recordType.IsSubclassOf(typeof(Record)))
     {
         throw new Exception("recordType must be a subclass of Sql.ARow");
     }
     this.defaultDatabase       = db;
     this.tableName             = tableName;
     this.rowType               = recordType;
     this.isTemporaryTable      = pIsTemporaryTable;
     this.alias                 = "_" + TableBase.GetNextAlias();
     this.useConcurrenyChecking = pUseConcurrenyChecking;
 }
コード例 #2
0
ファイル: TableBase.cs プロジェクト: gunivan/cooq
        /// <summary>
        /// Creates a temporary table with an auto generated table name
        ///
        /// </summary>
        /// <param name="recordType"/>
        protected TableBase(Type recordType)
        {
            if (!recordType.IsSubclassOf(typeof(Record)))
            {
                throw new Exception("recordType must be a subclass of Sql.ARow");
            }
            this.rowType          = recordType;
            this.isTemporaryTable = true;
            string nextAlias = TableBase.GetNextAlias();

            this.tableName             = "Temp_" + nextAlias;
            this.alias                 = "_" + nextAlias;
            this.useConcurrenyChecking = new bool?();
        }