Example #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;
 }
Example #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;
 }
Example #3
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");
 }
Example #4
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");
 }
            private void Init(bool isError, ViewGenErrorCode errorCode, string message,
                              IEnumerable <Cell> sourceCells, string debugMessage)
            {
                m_sourceCells = new List <Cell>(sourceCells);

                Debug.Assert(m_sourceCells.Count > 0, "Error record must have at least one cell");

                // For certain foreign key messages, we may need the SSDL line numbers and file names
                CellLabel label          = m_sourceCells[0].CellLabel;
                string    sourceLocation = label.SourceLocation;
                int       lineNumber     = label.StartLineNumber;
                int       columnNumber   = label.StartLinePosition;

                string userMessage = InternalToString(message, debugMessage, m_sourceCells, sourceLocation, errorCode, isError, false);

                m_debugMessage = InternalToString(message, debugMessage, m_sourceCells, sourceLocation, errorCode, isError, true);
                m_mappingError = new EdmSchemaError(userMessage, (int)errorCode, EdmSchemaErrorSeverity.Error, sourceLocation,
                                                    lineNumber, columnNumber);
            }
Example #6
0
 internal static Cell CreateCS(CellQuery cQuery, CellQuery sQuery, CellLabel label, int cellNumber)
 {
     return new Cell(cQuery, sQuery, label, cellNumber);
 }
 /// <summary>
 /// Copy Constructor
 /// </summary>
 internal CellLabel(CellLabel source)
 {
     this.m_startLineNumber   = source.m_startLineNumber;
     this.m_startLinePosition = source.m_startLinePosition;
     this.m_sourceLocation    = source.m_sourceLocation;
 }
        // 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);
        }
Example #9
0
 /// <summary>
 /// Copy Constructor
 /// </summary>
 internal CellLabel(CellLabel source)
 {
     this.m_startLineNumber = source.m_startLineNumber;
     this.m_startLinePosition = source.m_startLinePosition;
     this.m_sourceLocation = source.m_sourceLocation;
 }
Example #10
0
 internal static Cell CreateCS(CellQuery cQuery, CellQuery sQuery, CellLabel label, int cellNumber)
 {
     return(new Cell(cQuery, sQuery, label, cellNumber));
 }