public void CreateTable() { if (mDbMgr.TableExists(mTablename)) { return; } DbGenerateTableStatement clause = mDbMgr.CreateGenerateTableClause(); clause .CreateTable(mTablename) .WithPrimaryKey(mPrimaryKey); foreach (string fieldname in mFields.Keys) { clause.WithField(fieldname, mFields[fieldname]); } foreach (string fieldname in mForeignKeys.Keys) { clause.WithReference(fieldname, mForeignKeys[fieldname]); } mDbMgr.ExecuteNonQuery(clause); }
protected virtual DbGenerateTableStatement BuildClause() { DbGenerateTableStatement clause = mDbMgr.CreateGenerateTableClause(); clause .CreateTable(mTablename) .WithPrimaryKey(mPrimaryKey); foreach (string fieldname in mFields.Keys) { clause.WithField(fieldname, mFields[fieldname]); } foreach (string fieldname in mForeignKeys.Keys) { clause.WithReference(fieldname, mForeignKeys[fieldname]); } return(clause); }