Skip to content

DbQuery class

Represents query for building SQL command

public class Korzh.EasyQuery.Db.DbQuery
: Query
TypeNameDescription
TableListExtraTablesGets the list of “extra” tables (the tables which will be included into result query by user request).
NoPathResolutionNoPathResolutionGet or set the type of reaction for the situation when two tables have no path between them
SqlExtrasOptionsGets the Korzh.EasyQuery.Db.SqlExtras object which defines some extra clauses of generated query.
IEnumerable<Column>ResultColumnsGets the full list of columns which will be returned in result query. It equals to Columns list if it’s not empty. Otherwise - it’s an array of all fields from all tables taking part in this query (like SELECT * in SQL).
TypeNameDescription
CondSqlGenEventHandlerCondSqlGenThis event is raised during query building for each condition in the query and it allows you to replace the SQL expression generated for this condition.
TypeNameDescription
voidCheckModelObject(DataModel model)Checks if model object has appropriate type and raise exception if not
voidCoreClear()Clears all query content. Can be overriden in derived classes.
ColumnCreateColumnCore()Creates the column object. This particular implementation returns and instance of DbColumn class
QueryFormatsCreateFormats()Gets the formats of generated query language (SQL or other).
EntityAttrExprCreateParentEntityAttrExpr(EntityAttr attr)Creates the parent entity attribute expression.
EqExpressionCreateQueryExpr()Creates a sub-query expression.
QueryCreateSubQuery()Creates the subquery.
EntityGetParentQueryRootEntity()Gets the entities from parent query.
List<Entity>GetUsedEntities()Gets the list of used entities.
TableListGetUsedTables()Gets the used tables.
voidLoadNode(XmlReader reader, QueryReadWriteOptions rwOptions)Loads the root node.
DataModelNewModel()Creates a new model (an object of DataModel class or its descendant).
BooleanOnCondSqlGen(CondSqlGenEventArgs e)Raises the CondSqlGen event.
voidReadOnePropFromJson(JsonReader reader, String propName, QueryReadWriteOptions rwOptions)Reads the property from JSON reader or skip unused.
TaskReadOnePropFromJsonAsync(JsonReader reader, String propName, QueryReadWriteOptions rwOptions)Reads the property from JSON reader or skip unused (asynchronous way).
voidSaveNodes(XmlWriter writer, QueryReadWriteOptions rwOptions)Saves the root nodes.
voidWritePropertiesToJson(JsonWriter writer, QueryReadWriteOptions rwOptions)Saves content of the query to JSON.
TaskWritePropertiesToJsonAsync(JsonWriter writer, QueryReadWriteOptions rwOptions)Saves content of the query to JSON (asynchronous way).