Exemplo n.º 1
0
        internal override string CreateSqlString(CommandFactory factory, bool isFullName, CreateSqlState state)
        {
            string sql = state.GetDataSql(this, isFullName);

            if (sql != null)
            {
                return(sql);
            }

            string tableName   = factory.CreateDataTableMappingSql(TableMapping, state);
            string selectField = _selectField.CreateSqlString(factory, true, state);

            string field = _field.CreateSqlString(factory, isFullName, state);

            string query = null;

            if (_expression != null)
            {
                query = _expression.CreateSqlString(factory, true, state);
            }
            sql = factory.CreateSubQuerySql(field, _predicate, selectField, tableName, query);

            state.SetDataSql(this, isFullName, sql);
            return(sql);
        }