public string DeleteByMethod(ColumnInfo column) {
     String name = column.PropName;
     return String.Format(DaoMethodSetOption.DeleteByOption.IdFmt, String.Empty, name);
 }
 public string DeleteByStmtId(ColumnInfo column) {
     String name = column.PropName;
     return String.Format(DaoMethodSetOption.DeleteByOption.IdFmt, IdBase, name);
 }
        /// <summary>Creates an instance.</summary>
        public TableBuilder(TableSchema sourceTable, ITableBuilderOption builderOption) {
            if (sourceTable == null) throw new ArgumentNullException("sourceTable");
            if (builderOption == null) throw new ArgumentNullException("builderOption");

            m_SourceTable = sourceTable;
            m_BuilderOption = builderOption;
            m_DbVendor = DbVendorProvider.GetVendor(m_BuilderOption.SqlOption.VendorId);

            m_TableName = DbVendor.QuotedStr(SourceTable.Name);
            m_QualifiedTableName = string.IsNullOrEmpty(SourceTable.Owner) ? TableName : DbVendor.QuotedStr(SourceTable.Owner) + "." + TableName;

            m_EntityNamespace = EntityOption.Namespace;
            m_EntityName = GetEntityName(SourceTable.Name, EntityOption);
            m_EntityFullName = CSHelper.GetQualifiedName(EntityName, EntityNamespace);
            m_EntityQualifiedName = CSHelper.GetAssemblyQualifiedName(EntityFullName, EntityOption.Assembly);
            m_EntityPartialDecl = EntityOption.IsPartial ? "partial " : String.Empty;
            m_EntityBaseDecl = String.IsNullOrEmpty(EntityOption.BaseType) ? String.Empty : " : " + EntityOption.BaseType;

            m_DaoIntfNamespace = DaoIntfOption.Namespace;
            m_DaoIntfName = String.Format(DaoIntfOption.NameFmt, EntityName);
            m_DaoIntfFullName = CSHelper.GetQualifiedName(DaoIntfName, DaoIntfNamespace);
            m_DaoIntfQualifiedName = CSHelper.GetAssemblyQualifiedName(DaoIntfFullName, DaoIntfOption.Assembly);
            m_DaoIntfPartialDecl = DaoIntfOption.IsPartial ? "partial " : String.Empty;
            m_DaoIntfBaseDecl = String.IsNullOrEmpty(DaoIntfOption.BaseType) ? String.Empty : " : " + DaoIntfOption.BaseType;

            m_DaoImplNamespace = DaoImplOption.Namespace;
            m_DaoImplName = String.Format(DaoImplOption.NameFmt, EntityName);
            m_DaoImplFullName = CSHelper.GetQualifiedName(DaoImplName, DaoImplNamespace);
            m_DaoImplQualifiedName = CSHelper.GetAssemblyQualifiedName(DaoImplQualifiedName, DaoImplOption.Assembly);
            m_DaoImplPartialDecl = DaoImplOption.IsPartial ? "partial " : String.Empty;
            m_DaoImplBaseDecl = " : " + DaoImplOption.BaseType 
                + (String.IsNullOrEmpty(DaoImplOption.BaseType) ? String.Empty : ", ") 
                + m_DaoIntfName;
            m_SqlMapper = DaoImplOption.SqlMapperFmt;

            int columnCount = SourceTable.Columns.Count;
            bool isSingleColumnPk = SourceTable.PrimaryKey.MemberColumns.Count == 1;    //If the table has a single-column primary key.

            //Initialize column lists
            List<ColumnInfo> columns = new List<ColumnInfo>(columnCount);
            List<ColumnInfo> pkColumns = new List<ColumnInfo>(SourceTable.PrimaryKey.MemberColumns.Count);
            List<ColumnInfo> nonPkColumns = new List<ColumnInfo>(columnCount);
            List<ColumnInfo> finderColumns = new List<ColumnInfo>(columnCount);
            List<ColumnInfo> lobColumns = new List<ColumnInfo>(columnCount);
            List<ColumnInfo> nonLobColumns = new List<ColumnInfo>(columnCount);

            foreach (ColumnSchema c in SourceTable.Columns) {
                ColumnInfo cb = new ColumnInfo(c, MemberOption, SqlOption, DbVendor);
                columns.Add(cb);

                if (c.IsPrimaryKeyMember) {
                    pkColumns.Add(cb);
                } else {
                    nonPkColumns.Add(cb);
                }

                if (cb.IsLob)
                    lobColumns.Add(cb);
                else
                    nonLobColumns.Add(cb);

                //Determinates if the column will be used in FindByXXX.
                if (c.IsPrimaryKeyMember && isSingleColumnPk) continue;
                if (cb.IsLob) continue;
                finderColumns.Add(cb);
            }
            m_Columns = columns.AsReadOnly();
            m_PkColumns = pkColumns.AsReadOnly();
            m_NonPkColumns = nonPkColumns.AsReadOnly();
            m_FinderColumns = finderColumns.AsReadOnly();
            m_LobColumns = lobColumns.AsReadOnly();
            m_NonLobColumns = nonLobColumns.AsReadOnly();

            m_HasLob = lobColumns.Count > 0;
            m_IdBase = GetIdBase(m_EntityName, m_EntityNamespace, SqlOption);
        }