Esempio n. 1
0
 // <summary>
 // Copy Constructor
 // </summary>
 internal Cell(Cell source)
 {
     m_cQuery     = new CellQuery(source.m_cQuery);
     m_sQuery     = new CellQuery(source.m_sQuery);
     m_label      = new CellLabel(source.m_label);
     m_cellNumber = source.m_cellNumber;
 }
Esempio n. 2
0
 /// <summary>
 /// Copy Constructor
 /// </summary>
 internal Cell(Cell source)
 {
     m_cQuery = new CellQuery(source.m_cQuery);
     m_sQuery = new CellQuery(source.m_sQuery);
     m_label = new CellLabel(source.m_label);
     m_cellNumber = source.m_cellNumber;
 }
 private Cell(CellQuery cQuery, CellQuery sQuery, CellLabel label, int cellNumber)
 {
     this.m_cQuery     = cQuery;
     this.m_sQuery     = sQuery;
     this.m_label      = label;
     this.m_cellNumber = cellNumber;
 }
 internal static Cell CreateCS(
     CellQuery cQuery,
     CellQuery sQuery,
     CellLabel label,
     int cellNumber)
 {
     return(new Cell(cQuery, sQuery, label, cellNumber));
 }
Esempio n. 5
0
 // effects: Creates a cell with the C and S queries
 private Cell(CellQuery cQuery, CellQuery sQuery, CellLabel label, int cellNumber)
 {
     DebugCheck.NotNull(label);
     m_cQuery     = cQuery;
     m_sQuery     = sQuery;
     m_label      = label;
     m_cellNumber = cellNumber;
     Debug.Assert(
         m_sQuery.NumProjectedSlots == m_cQuery.NumProjectedSlots,
         "Cell queries disagree on the number of projected fields");
 }
Esempio n. 6
0
 // effects: Creates a cell with the C and S queries 
 private Cell(CellQuery cQuery, CellQuery sQuery, CellLabel label, int cellNumber)
 {
     Debug.Assert(label != null, "Cell lacks label");
     m_cQuery = cQuery;
     m_sQuery = sQuery;
     m_label = label;
     m_cellNumber = cellNumber;
     Debug.Assert(
         m_sQuery.NumProjectedSlots == m_cQuery.NumProjectedSlots,
         "Cell queries disagree on the number of projected fields");
 }
Esempio n. 7
0
            private void Init(
                ViewGenErrorCode errorCode,
                string message,
                IEnumerable <Cell> sourceCells,
                string debugMessage)
            {
                this.m_sourceCells = new List <Cell>(sourceCells);
                CellLabel cellLabel         = this.m_sourceCells[0].CellLabel;
                string    sourceLocation    = cellLabel.SourceLocation;
                int       startLineNumber   = cellLabel.StartLineNumber;
                int       startLinePosition = cellLabel.StartLinePosition;
                string    message1          = ErrorLog.Record.InternalToString(message, debugMessage, this.m_sourceCells, errorCode, false);

                this.m_debugMessage = ErrorLog.Record.InternalToString(message, debugMessage, this.m_sourceCells, errorCode, true);
                this.m_mappingError = new EdmSchemaError(message1, (int)errorCode, EdmSchemaErrorSeverity.Error, sourceLocation, startLineNumber, startLinePosition);
            }
Esempio n. 8
0
 internal static Cell CreateCS(CellQuery cQuery, CellQuery sQuery, CellLabel label, int cellNumber)
 {
     return new Cell(cQuery, sQuery, label, cellNumber);
 }
        // effects: Given an extent's ("extent") table fragment that is
        // contained inside typeMap, determine the cells that need to be
        // created and add them to cells
        // allTypes corresponds to all the different types that the type map
        // represents -- this parameter has something useful only if extent
        // is an entity set
        private void ExtractCellsFromTableFragment(
            EntitySetBase extent, StorageMappingFragment fragmentMap,
            Set<EdmType> allTypes, List<Cell> cells)
        {
            // create C-query components
            var cRootExtent = new MemberPath(extent);
            var cQueryWhereClause = BoolExpression.True;
            var cSlots = new List<ProjectedSlot>();

            if (allTypes.Count > 0)
            {
                // Create a type condition for the extent, i.e., "extent in allTypes"
                cQueryWhereClause = BoolExpression.CreateLiteral(new TypeRestriction(cRootExtent, allTypes), null);
            }

            // create S-query components
            var sRootExtent = new MemberPath(fragmentMap.TableSet);
            var sQueryWhereClause = BoolExpression.True;
            var sSlots = new List<ProjectedSlot>();

            // Association or entity set
            // Add the properties and the key properties to a list and
            // then process them in ExtractProperties
            ExtractProperties(
                fragmentMap.AllProperties, cRootExtent, cSlots, ref cQueryWhereClause, sRootExtent, sSlots, ref sQueryWhereClause);

            // limitation of MSL API: cannot assign constant values to table columns
            var cQuery = new CellQuery(cSlots, cQueryWhereClause, cRootExtent, CellQuery.SelectDistinct.No /*no distinct flag*/);
            var sQuery = new CellQuery(
                sSlots, sQueryWhereClause, sRootExtent,
                fragmentMap.IsSQueryDistinct ? CellQuery.SelectDistinct.Yes : CellQuery.SelectDistinct.No);

            var fragmentInfo = fragmentMap;
            Debug.Assert((fragmentInfo != null), "CSMappingFragment should support Line Info");
            var label = new CellLabel(fragmentInfo);
            var cell = Cell.CreateCS(cQuery, sQuery, label, m_currentCellNumber);
            m_currentCellNumber++;
            cells.Add(cell);
        }