Click or drag to resize

DynamicQueryEngine Class

DynamicQueryEngine for SqlServer.
Inheritance Hierarchy

Namespace:  SD.LLBLGen.Pro.DQE.SqlServer
Assembly:  SD.LLBLGen.Pro.DQE.SqlServer (in SD.LLBLGen.Pro.DQE.SqlServer.dll) Version: 5.5.0.0 (5.5.18.1019)
Syntax
public class DynamicQueryEngine : DynamicQueryEngineBase

The DynamicQueryEngine type exposes the following members.

Constructors
  NameDescription
Public methodDynamicQueryEngine
Creates a new DynamicQueryEngine instance.
Top
Properties
  NameDescription
Public propertyCompatibilityLevel
The per-instance compatibility level used by this DQE instance. Default is the one set globally, which is by default SqlServer2005 (for 2005+). Compatibility level influences the query generated for paging, sequence name (@@IDENTITY/SCOPE_IDENTITY()), and usage of newsequenceid() in inserts. It also influences the ado.net provider to use. This way you can switch between SqlServer server client 'SqlClient' and SqlServer CE Desktop.
Public propertyCreator
Gets / sets creator
(Inherited from DynamicQueryEngineBase.)
Public propertyStatic memberDefaultCompatibilityLevel
The default compatibility level used by the DQE. Default is SqlServer2005 (for 2005+). To utilize SqlServer 2000 specific features, set this property to SqlServer2000, either through a setting in the .config file of your application or by setting this parameter once in your application. Compatibility level influences the query generated for paging, sequence name (@@IDENTITY/SCOPE_IDENTITY()), and usage of newsequenceid() in inserts. It also influences the ado.net provider to use. This way you can switch between SqlServer server client 'SqlClient' and SqlServer CE Desktop.
Public propertyDistinctFilteringPreferenceToUse
Gets or sets the distinct filtering preference to use. The default value is the value of the global variable DynamicQueryEngineBase.DistinctFilteringPreferenceDefault.
(Inherited from DynamicQueryEngineBase.)
Public propertyFactoryToUse
Gets the DbProviderFactory to use for this DQE.
(Inherited from DynamicQueryEngineBase.)
Public propertyFunctionMappings
Gets the function mappings for the particular DQE. These function mappings are static and therefore not changeable.
(Overrides DynamicQueryEngineBaseFunctionMappings.)
Public propertyPerCallCatalogNameOverwrites
Gets / sets perCallCatalogNameOverwrites name pairs
(Inherited from DynamicQueryEngineBase.)
Public propertyPerCallSchemaNameOverwrites
Gets / sets perCallSchemaNameOverwrites name pairs
(Inherited from DynamicQueryEngineBase.)
Public propertySupportsPackedQueries
Gets whether the database of this DQE supports packed queries, which are queries with multiple SQL statements packed together in a single DbCommand. By default this property returns false.
(Overrides DynamicQueryEngineBaseSupportsPackedQueries.)
Top
Methods
  NameDescription
Protected methodAddSingleTargetElementToFromClause
Adds a single target element to from clause. This is used when there's no join to add, but instead a single target. Takes care of hint emitting if required.
(Inherited from DynamicQueryEngineBase.)
Protected methodAppendFieldExpressionAsValueForInsert
Appends the field's expression as value to the specified valueFragments list for the specified insert query. It also appends the parameters to the query as parameters (not anonymized yet)
(Inherited from DynamicQueryEngineBase.)
Protected methodAppendFieldToValueFragmentsForInsert
Appends the field (or its expresssion) to the value fragments of the query specified for insert.
(Inherited from DynamicQueryEngineBase.)
Protected methodAppendFromClause
Appends a FROM clause with the contents of the elements specified to the destination and adds the parameters (if any) to the query to append to.
(Inherited from DynamicQueryEngineBase.)
Protected methodAppendGroupByClause
Appends a GROUP BY clause with the contents of the filter if it's not null / empty, to the fragments object specified. Parameters are added to the query specified
(Inherited from DynamicQueryEngineBase.)
Protected methodAppendOrderByClause
Appends an GROUP BY clause with the contents of the filter if it's not null / empty, to the fragments object specified. Parameters are added to the query specified
(Inherited from DynamicQueryEngineBase.)
Protected methodAppendQueryHints
Appends the hints specified a single prefix hintstring suffix clause to the fragments specified.
(Inherited from DynamicQueryEngineBase.)
Protected methodAppendResultsetFieldsToQuery
Appends all resultset fields to the query specified using the parameters specified and outputs values detected along the way during the process for further query construction.
(Inherited from DynamicQueryEngineBase.)
Protected methodAppendUnionedQueries
Appends, if specified, the unioned queries to the fragments specified, wrapping nested queries in () if necessary. Parameters are appneded to query.
(Inherited from DynamicQueryEngineBase.)
Protected methodAppendUpdateSetClauses(IListIEntityFieldCore, IListIFieldPersistenceInfo, QueryFragments, IList)
Appends set clauses for an update query using the input specified to the destination list specified
(Inherited from DynamicQueryEngineBase.)
Protected methodAppendUpdateSetClauses(IListIEntityFieldCore, IListIFieldPersistenceInfo, QueryFragments, IList, Boolean)
Appends set clauses for an update query using the input specified to the destination list specified
(Inherited from DynamicQueryEngineBase.)
Protected methodAppendWhereClause
Appends a WHERE clause with the contents of the filter if it's not null / empty, to the fragments object specified. Parameters are added to the query specified
(Inherited from DynamicQueryEngineBase.)
Protected methodCheckIfFieldNeedsInsertAction
Checks the if field needs insert action.
(Inherited from DynamicQueryEngineBase.)
Protected methodConstructFieldsToUpdateList
Constructs the list of fields to update plus its corresponding fieldpersistenceinfo list.
(Inherited from DynamicQueryEngineBase.)
Protected methodCreateActionQueryFromSQL
Creates the action query from the sql query specified using the parameter values specified.
(Inherited from DynamicQueryEngineBase.)
Protected methodCreateCommand
Creates the command.
(Inherited from DynamicQueryEngineBase.)
Protected methodCreateCommand(DbConnection)
Creates a new DbCommand object and initializes it
(Overrides DynamicQueryEngineBaseCreateCommand(DbConnection).)
Protected methodCreateCommand(String)
Creates a new DbCommand object and initializes it
(Inherited from DynamicQueryEngineBase.)
Protected methodCreateCommand(String, DbConnection)
Creates a new DbCommand object and initializes it
(Inherited from DynamicQueryEngineBase.)
Protected methodCreateDbSpecificCreator
Creates a new IDbSpecificCreator and initializes it
(Overrides DynamicQueryEngineBaseCreateDbSpecificCreator.)
Public methodCreateDeleteDQ(IFieldPersistenceInfo, DbConnection, ListIPredicate)
Creates a new Delete Query object which is ready to use.
(Inherited from DynamicQueryEngineBase.)
Public methodCreateDeleteDQ(IFieldPersistenceInfo, DbConnection, ListIPredicate, IPredicate, IRelationCollection)
Creates a new Delete Query object which is ready to use.
(Inherited from DynamicQueryEngineBase.)
Public methodCreateInsertDQ(IEntityFields, DbConnection)
Creates a new Insert Query object which is ready to use.
(Inherited from DynamicQueryEngineBase.)
Public methodCreateInsertDQ(IEntityFieldCore, IFieldPersistenceInfo, DbConnection)
Creates a new Insert Query object which is ready to use.
(Inherited from DynamicQueryEngineBase.)
Protected methodCreatePagingSelectDQ
Creates a new Select Query which is ready to use, based on the query parameters specified.
(Overrides DynamicQueryEngineBaseCreatePagingSelectDQ(QueryParameters, DbConnection).)
Protected methodCreateRealQueryAndParameters
Creates the real sql query to execute from the query in string form and the parameters specified. It updates 'query' with the constructed string and real DbParameter instances.
(Inherited from DynamicQueryEngineBase.)
Protected methodCreateRetrievalQueryFromSQL
Creates the retrieval query from the SQL query specified using the parameter values specified and is configured with the aspects specified.
(Inherited from DynamicQueryEngineBase.)
Public methodCreateRowCountDQ
Creates a select query which will be executed as a scalar, and which will return a single value, the number of rows in the query formed by the elements passed in.
(Inherited from DynamicQueryEngineBase.)
Public methodCreateSelectDQ
Creates a new Select Query which is ready to use, based on the specified select list and the specified set of relations. If selectFilter is set to null, all rows are selected.
(Inherited from DynamicQueryEngineBase.)
Protected methodCreateSelectDQImpl
Creates a new Select Query which is ready to use, based on the specified elements.
(Overrides DynamicQueryEngineBaseCreateSelectDQImpl(QueryParameters, DbConnection).)
Protected methodCreateSingleTargetDeleteDQ(IFieldPersistenceInfo, IActionQuery, IPredicate)
Creates a new Delete Query object which is ready to use.
(Overrides DynamicQueryEngineBaseCreateSingleTargetDeleteDQ(IFieldPersistenceInfo, IActionQuery, IPredicate).)
Protected methodCreateSingleTargetDeleteDQ(IFieldPersistenceInfo, IActionQuery, IPredicate, IRelationCollection)
Creates a new Delete Query object which is ready to use.
(Overrides DynamicQueryEngineBaseCreateSingleTargetDeleteDQ(IFieldPersistenceInfo, IActionQuery, IPredicate, IRelationCollection).)
Protected methodCreateSingleTargetDeleteDQUsingCorrelatedSubQuery
Creates a new Delete Query object which is ready to use.
(Inherited from DynamicQueryEngineBase.)
Protected methodCreateSingleTargetDeleteDQUsingKeywordClause
Creates a new Delete Query object which is ready to use. Uses keyword clause (using keyword FROM/USING etc.)) for filtering
(Inherited from DynamicQueryEngineBase.)
Protected methodCreateSingleTargetInsertDQ
Creates a new Insert Query object which is ready to use.
(Overrides DynamicQueryEngineBaseCreateSingleTargetInsertDQ(IEntityFieldCore, IFieldPersistenceInfo, IActionQuery, DictionaryIEntityFieldCore, DbParameter).)
Protected methodCreateSingleTargetUpdateDQ(IEntityFieldCore, IFieldPersistenceInfo, IActionQuery, IPredicate)
Creates a new Update Query object which is ready to use. Only 'changed' EntityFieldCore fields are included in the update query. Primary Key fields are never updated.
(Overrides DynamicQueryEngineBaseCreateSingleTargetUpdateDQ(IEntityFieldCore, IFieldPersistenceInfo, IActionQuery, IPredicate).)
Protected methodCreateSingleTargetUpdateDQ(IEntityFieldCore, IFieldPersistenceInfo, IActionQuery, IPredicate, IRelationCollection)
Creates a new Update Query object which is ready to use. Only 'changed' EntityFieldCore are included in the update query. Primary Key fields are never updated.
(Overrides DynamicQueryEngineBaseCreateSingleTargetUpdateDQ(IEntityFieldCore, IFieldPersistenceInfo, IActionQuery, IPredicate, IRelationCollection).)
Protected methodCreateSingleTargetUpdateDQUsingCorrelatedSubQuery
Creates a new Update Query object which is ready to use. Only 'changed' EntityFieldCore are included in the update query. Primary Key fields are never updated. Uses a correlated subquery for filtering
(Inherited from DynamicQueryEngineBase.)
Protected methodCreateSingleTargetUpdateDQUsingFromClause
Creates a new Update Query object which is ready to use. Only 'changed' EntityFieldCore are included in the update query. Primary Key fields are never updated. Uses a FROM clause for filtering
(Inherited from DynamicQueryEngineBase.)
Protected methodCreateSubqueryConnectionClausesDelete
Produces a set of WHERE Clauses to use in the DELETE queries which have filters spanning multiple entities. It produces one clause if it finds the deleteTable on the PK side and then stops and it produces n clauses if it finds deleteTable on the FK side of n relations in relationsToWalk. If the deleteTable is on the PK side, it produces a clause: deleteTableAlias.PKField1 = deleteTable.PKField1 AND... (for each field in the PK 1 clause) If the deleteTable is on the FK side, it produces deleteTableAlias.Field1 = relatedEntityTable.Field1 AND ... clauses for each relation the table of the persistence info is in.
(Inherited from DynamicQueryEngineBase.)
Protected methodCreateSubqueryConnectionClausesUpdate
Produces a set of WHERE Clauses to use in the UPDATE queries which have filters spanning multiple entities. It produces one clause if it finds the updateTable on the PK side and then stops and it produces n clauses if it finds updateTable on the FK side of n relations in relationsToWalk. If the updateTable is on the PK side, it produces a clause: updatedTableAlias.PKField1 = updateTable.PKField1 AND... (for each field in the PK 1 clause) If the updateTable is on the FK side, it produces updatedTableAlias.Field1 = relatedEntityTable.Field1 AND ... clauses for each relation the table of the persistence info is in.
(Inherited from DynamicQueryEngineBase.)
Protected methodCreateTvfCallQuery
Creates a retrieval query for the tvfcall specified.
(Inherited from DynamicQueryEngineBase.)
Protected methodCreateTvfFunctionNameFragmentList
Creates the TVF function name fragment list. By default it will create 'FunctionName(parameterList)'. Override this method if the DQE requires a different strategy to call a TVF, e.g. wrapping it.
(Inherited from DynamicQueryEngineBase.)
Public methodCreateUpdateDQ(IEntityFields, DbConnection, ListIPredicate)
Creates a new Update Query object which is ready to use. Only 'changed' EntityFields are included in the update query. Primary Key fields are never updated.
(Inherited from DynamicQueryEngineBase.)
Public methodCreateUpdateDQ(IEntityFieldCore, IFieldPersistenceInfo, DbConnection, ListIPredicate)
Creates a new Update Query object which is ready to use. Only 'changed' EntityFieldCore fields are included in the update query.
(Inherited from DynamicQueryEngineBase.)
Public methodCreateUpdateDQ(IEntityFields, DbConnection, ListIPredicate, IPredicate, IRelationCollection)
Creates a new Update Query object which is ready to use. Only 'changed' EntityFieldCore are included in the update query. Primary Key fields are never updated.
(Inherited from DynamicQueryEngineBase.)
Public methodCreateUpdateDQ(IEntityFieldCore, IFieldPersistenceInfo, DbConnection, ListIPredicate, IPredicate, IRelationCollection)
Creates a new Update Query object which is ready to use. Only 'changed' EntityFieldCore are included in the update query. Primary Key fields are never updated.
(Inherited from DynamicQueryEngineBase.)
Protected methodDetermineIfDuplicatesWillOccur
Determines if duplicates will occur.
(Inherited from DynamicQueryEngineBase.)
Protected methodDetermineIfFieldAliasIsRequired
Determines if field alias is required.
(Inherited from DynamicQueryEngineBase.)
Protected methodDetermineObjectAliasToUseForSelectListField
Determines the object alias to use for select list field.
(Inherited from DynamicQueryEngineBase.)
Protected methodDetermineTargetAlias
Determines the target alias to use for a single target FROM clause.
(Inherited from DynamicQueryEngineBase.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Protected methodGetCorrectFieldTypeBasedOnTypeSpecs
Gets the correct field type, based on the type and lenght specified in the specified persistenceInfo
(Overrides DynamicQueryEngineBaseGetCorrectFieldTypeBasedOnTypeSpecs(IFieldPersistenceInfo).)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetNewCatalogName
Gets the new name for the catalog, given the current name. If the current name is not found in the list of catalog name overwrites, the current name is returned. This routine works on the catalog names specified in the config file.
(Overrides DynamicQueryEngineBaseGetNewCatalogName(String).)
Public methodGetNewPerCallSequenceName
Gets the new name of the sequence passed in. Overwrites catalog and schema name, if overwrites are defined, per call and global.
(Overrides DynamicQueryEngineBaseGetNewPerCallSequenceName(String).)
Public methodGetNewPerCallStoredProcedureName
Gets the new name of the stored procedure passed in. Overwrites schema and catalog name with a new name if these names have been defined for overwriting. This routine works on the PerCallCatalogNameOverwrites and PerCallSchemaNameOverwrites names specified on this instance
(Overrides DynamicQueryEngineBaseGetNewPerCallStoredProcedureName(String).)
Public methodGetNewSchemaName
Gets the new name for the schema, given the current name. If the current name is not found in the list of schema name overwrites, the current name is returned. This routine works on the schema names specified in the config file.
(Overrides DynamicQueryEngineBaseGetNewSchemaName(String).)
Public methodGetNewSequenceName
Gets the new name of the sequence passed in. Default implementation overwrites schema name with a new name if the name has been defined for overwriting.
(Inherited from DynamicQueryEngineBase.)
Public methodGetNewStoredProcedureName
Gets the new name of the stored procedure passed in. Overwrites schema and catalog name with a new name if these names have been defined for overwriting. This routine works on the catalog and schema names specified in the config file.
(Overrides DynamicQueryEngineBaseGetNewStoredProcedureName(String).)
Protected methodGetNullInProjectionFragment
Gets the fragment to use in a projection for a literal NULL. By default this is 'NULL', but some databases need extra processing around NULL. Do to so, override this method.
(Inherited from DynamicQueryEngineBase.)
Protected methodGetTvfFunctionNameToUse
Gets the table valued function name to use. By default it creates an object name from the elements specified like a table name.
(Inherited from DynamicQueryEngineBase.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodHandleDistinctEmit
Handles the emit of 'DISTINCT' into the query text and returns true if distinct was emitted or false if not.
(Inherited from DynamicQueryEngineBase.)
Protected methodMakeParametersAnonymous(DbCommand)
Makes the parameters anonymous in the passed in query. An anonymous parameter is '?', not '@foo'. It walks all parameters and replaces the names of these parameters with "?" in the query text
(Inherited from DynamicQueryEngineBase.)
Protected methodMakeParametersAnonymous(String, IList)
Makes the parameters anonymous in the passed in query. An anonymous parameter is '?', not '@foo'. It walks all parameters and replaces the names of these parameters with "?" in the query text
(Inherited from DynamicQueryEngineBase.)
Protected methodManglePageSelectDQ2000
Mangles the page select d q.
Protected methodManglePageSelectDQ2005
Creates a CTE using paging query for SqlServer 2005 or higher.
Protected methodManglePageSelectDQ2012(IRetrievalQuery, Int32, Int32)
Creates a query using OFFSET and FETCH NEXT. For SQL Server 2012 and later.
Protected methodManglePageSelectDQ2012(IRetrievalQuery, Int32, Int32, Boolean)
Creates a query using OFFSET and FETCH NEXT. For SQL Server 2012 and later.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodReAssembleFragments
Reassembles the fragments specified, with separting '.'. If a fragment is empty, it's skipped
(Inherited from DynamicQueryEngineBase.)
Protected methodReAssembleStoredProcedureNameFragments
Re-assembles the stored procedure name from the fragments specified
(Inherited from DynamicQueryEngineBase.)
Protected methodResetCreator
Resets the creator object with a new one. Only used by DAO objects which keep a Dynamic Query Engine object alive.
(Inherited from DynamicQueryEngineBase.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Protected methodUpdateAliasInUpdateTablePredicates
Updates the SourceAlias in the predicates in updateFilter to the alias updatedTableAlias if the predicate targets the entity name specified.
(Inherited from DynamicQueryEngineBase.)
Protected methodWrapCommandInPagingQuery
Wraps the command in the query specified in a paging query and adds necessary parameters to the command.
(Overrides DynamicQueryEngineBaseWrapCommandInPagingQuery(IRetrievalQuery, Int32, Int32).)
Protected methodWrapQueryInBeginEndIfNecessary
Wraps the passed in query if necessary. By default it returns the toWrap string without doing any processing.
(Inherited from DynamicQueryEngineBase.)
Top
Fields
  NameDescription
Public fieldStatic memberArithAbortOn
Flag to signal the DQE to generate SET ARITHABORT ON statements prior to INSERT, DELETE and UPDATE Queries. Keep this flag to false in normal usage, but set it to true if you need to write into a table which is part of an indexed view. It will not affect normal inserts/updates that much, leaving it on is not harmful. Please consult SqlServer's Books online for more details on SET ARITHABORT ON. After each statement the setting is turned off if it has been turned on prior to that statement.
Public fieldStatic memberUseNoLockHintOnSelects
Flag to signal the DQE to tell the SqlServerSpecificCreator to create WITH NOLOCK hints on table references in select queries for FROM clauses. WITH NOLOCK is not recommended though in high volume databases with a lot of rows, it can be a lot of blocking can occur because SqlServer forces readers to block writers and vice versa. Please consult the SqlServer's Book online for more information about this hint and also the downsides for using it. The setting is global and for all select queries. Default is false and it should only be set to true in those situations in which no other option is available.
Top
See Also