Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Map / ViewGeneration / CqlGeneration / ExtentCqlBlock.cs / 1305376 / ExtentCqlBlock.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System.Text; using System.Collections.Generic; using System.Data.Mapping.ViewGeneration.Structures; using System.Data.Common.Utils; using System.Data.Metadata.Edm; namespace System.Data.Mapping.ViewGeneration.CqlGeneration { // A class that corresponds to the leaf CQL Blocks in the CqlBlock tree internal class ExtentCqlBlock : CqlBlock { private static readonly ListEmptyChildren = new List (); #region Constructors // effects: Creates an Extent CqlBlock corresponding to // "extent" (the FROM part). SELECT is given by slots, WHERE by // whereClause and AS by blockAliasNum internal ExtentCqlBlock(EntitySetBase extent, CellQuery.SelectDistinct selectDistinct, SlotInfo[] slots, BoolExpression whereClause, CqlIdentifiers identifiers, int blockAliasNum) : base(slots, EmptyChildren, whereClause, identifiers, blockAliasNum) { m_extent = extent; m_nodeTableAlias = identifiers.GetBlockAlias(); m_selectDistinct = selectDistinct; } #endregion #region Fields private EntitySetBase m_extent; // The extent for which we have this block private string m_nodeTableAlias; CellQuery.SelectDistinct m_selectDistinct; #endregion #region Methods // effects: See CqlBlock.AsCql internal override StringBuilder AsCql(StringBuilder builder, bool isTopLevel, int indentLevel) { // The SELECT part GenerateProjectedtList(builder, indentLevel, m_nodeTableAlias, m_selectDistinct, false); // Get the FROM part builder.Append("FROM "); // Get the extent object in C-Space (if m_extent is an S space object) CqlWriter.AppendEscapedQualifiedName(builder, m_extent.EntityContainer.Name, m_extent.Name); builder.Append(" AS ") .Append(m_nodeTableAlias); // Get the WHERE part only when the expression is not simply TRUE if (false == BoolExpression.EqualityComparer.Equals(WhereClause, BoolExpression.True)) { StringUtil.IndentNewLine(builder, indentLevel); builder.Append("WHERE "); WhereClause.AsCql(builder, m_nodeTableAlias); } return builder; } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System.Text; using System.Collections.Generic; using System.Data.Mapping.ViewGeneration.Structures; using System.Data.Common.Utils; using System.Data.Metadata.Edm; namespace System.Data.Mapping.ViewGeneration.CqlGeneration { // A class that corresponds to the leaf CQL Blocks in the CqlBlock tree internal class ExtentCqlBlock : CqlBlock { private static readonly ListEmptyChildren = new List (); #region Constructors // effects: Creates an Extent CqlBlock corresponding to // "extent" (the FROM part). SELECT is given by slots, WHERE by // whereClause and AS by blockAliasNum internal ExtentCqlBlock(EntitySetBase extent, CellQuery.SelectDistinct selectDistinct, SlotInfo[] slots, BoolExpression whereClause, CqlIdentifiers identifiers, int blockAliasNum) : base(slots, EmptyChildren, whereClause, identifiers, blockAliasNum) { m_extent = extent; m_nodeTableAlias = identifiers.GetBlockAlias(); m_selectDistinct = selectDistinct; } #endregion #region Fields private EntitySetBase m_extent; // The extent for which we have this block private string m_nodeTableAlias; CellQuery.SelectDistinct m_selectDistinct; #endregion #region Methods // effects: See CqlBlock.AsCql internal override StringBuilder AsCql(StringBuilder builder, bool isTopLevel, int indentLevel) { // The SELECT part GenerateProjectedtList(builder, indentLevel, m_nodeTableAlias, m_selectDistinct, false); // Get the FROM part builder.Append("FROM "); // Get the extent object in C-Space (if m_extent is an S space object) CqlWriter.AppendEscapedQualifiedName(builder, m_extent.EntityContainer.Name, m_extent.Name); builder.Append(" AS ") .Append(m_nodeTableAlias); // Get the WHERE part only when the expression is not simply TRUE if (false == BoolExpression.EqualityComparer.Equals(WhereClause, BoolExpression.True)) { StringUtil.IndentNewLine(builder, indentLevel); builder.Append("WHERE "); WhereClause.AsCql(builder, m_nodeTableAlias); } return builder; } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Literal.cs
- AutoFocusStyle.xaml.cs
- PersistenceTypeAttribute.cs
- Section.cs
- PersistChildrenAttribute.cs
- StorageComplexPropertyMapping.cs
- FontWeight.cs
- QueryAccessibilityHelpEvent.cs
- Positioning.cs
- AspNetHostingPermission.cs
- LocalClientSecuritySettingsElement.cs
- ParamArrayAttribute.cs
- TextUtf8RawTextWriter.cs
- DataProtection.cs
- CloseCryptoHandleRequest.cs
- HttpListenerRequest.cs
- AstNode.cs
- TextElementEditingBehaviorAttribute.cs
- ErrorProvider.cs
- DescendantBaseQuery.cs
- SpotLight.cs
- SmtpClient.cs
- EdmToObjectNamespaceMap.cs
- RegexMatch.cs
- ToolStripPanelSelectionGlyph.cs
- OutputCacheModule.cs
- GlobalizationAssembly.cs
- BamlVersionHeader.cs
- ErrorFormatterPage.cs
- Propagator.ExtentPlaceholderCreator.cs
- CheckBox.cs
- ToolStripArrowRenderEventArgs.cs
- RenamedEventArgs.cs
- GridViewCancelEditEventArgs.cs
- FileDialogCustomPlace.cs
- UnknownWrapper.cs
- ExpandableObjectConverter.cs
- PropertyPath.cs
- Cursor.cs
- EventMappingSettingsCollection.cs
- TypefaceMetricsCache.cs
- ReadOnlyMetadataCollection.cs
- ZipIOExtraFieldPaddingElement.cs
- SamlConditions.cs
- Filter.cs
- EntityViewGenerationConstants.cs
- WebPartEditorCancelVerb.cs
- StickyNoteContentControl.cs
- IntegerValidatorAttribute.cs
- GridProviderWrapper.cs
- SimpleBitVector32.cs
- BindingMemberInfo.cs
- NetDataContractSerializer.cs
- EntryPointNotFoundException.cs
- AstTree.cs
- RulePatternOps.cs
- ClientSponsor.cs
- DataServiceRequestException.cs
- GraphicsPath.cs
- CroppedBitmap.cs
- Margins.cs
- SimpleType.cs
- WCFBuildProvider.cs
- RectConverter.cs
- Vector.cs
- BinHexEncoding.cs
- ZeroOpNode.cs
- Constants.cs
- ObjectItemConventionAssemblyLoader.cs
- IApplicationTrustManager.cs
- Peer.cs
- formatter.cs
- Int16Converter.cs
- ISAPIRuntime.cs
- HttpBufferlessInputStream.cs
- ToolStripItemClickedEventArgs.cs
- InstallerTypeAttribute.cs
- MetadataArtifactLoaderFile.cs
- Odbc32.cs
- OneOfTypeConst.cs
- RadialGradientBrush.cs
- TriggerAction.cs
- SystemIPv6InterfaceProperties.cs
- BufferedOutputStream.cs
- XmlRawWriter.cs
- DbParameterCollectionHelper.cs
- ConnectionProviderAttribute.cs
- ContainerAction.cs
- IResourceProvider.cs
- ChangePassword.cs
- PolygonHotSpot.cs
- ArrayElementGridEntry.cs
- DataGridViewColumnHeaderCell.cs
- login.cs
- PageCache.cs
- MoveSizeWinEventHandler.cs
- PaintValueEventArgs.cs
- DbDataRecord.cs
- DrawingContext.cs
- EntityException.cs