Represents query for building SQL command
public class Korzh.EasyQuery.Db.DbQuery
: Query
Package: Korzh.EasyQuery.Db
(targets: netstandard2.0
)
Assembly: Korzh.EasyQuery.Db.dll
Constructors
Name | Type | Description |
---|---|---|
DbQuery(DataModel model, Query parentQuery) | void |
Initializes a new instance of the Korzh.EasyQuery.Db.DbQuery class. |
DbQuery(DataModel model) | void |
Initializes a new instance of the Korzh.EasyQuery.Db.DbQuery class. |
Properties
Name | Type | Description |
---|---|---|
ExtraTables | TableList | Gets the list of "extra" tables (the tables which will be included into result query by user request). |
NoPathResolution | NoPathResolution | Get or set the type of reaction for the situation when two tables have no path between them |
Options | SqlExtras | Gets the Korzh.EasyQuery.Db.SqlExtras object which defines some extra clauses of generated query. |
ResultColumns | IEnumerable <QueryColumn> |
Gets 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). |
Methods
Name | Type | Description |
---|---|---|
CheckModelObject(DataModel model) | void |
Checks if model object has appropriate type and raise exception if not |
CoreClear() | void |
Clears all query content. Can be overriden in derived classes. |
CreateColumn(IColumnDescriptor& modreq(System.Runtime.InteropServices.InAttribute) desc) |
QueryColumn | Creates a column by its descriptor |
CreateParentEntityAttrExpr(EntityAttr attr) | EntityAttrExpr | Creates the parent entity attribute expression. |
CreateQueryExpr() | EqExpression | Creates a sub-query expression. |
CreateSubQuery() | Query | Creates the subquery. |
GetParentQueryRootEntity() | Entity | Gets the entities from parent query. |
GetUsedEntities() | List <Entity> |
Gets the list of used entities. |
GetUsedTables() | TableList | Gets the used tables. |
LoadNode(XmlReader reader, BitOptions rwOptions) |
void |
Loads the root node. |
NewModel() | DataModel | Creates a new model (an object of DataModel class or its descendant). |
ReadOnePropFromJsonAsync(JsonReader reader, string propName, BitOptions rwOptions) |
Task |
Reads the property from JSON reader or skip unused (asynchronous way). |
SaveNodes(XmlWriter writer, BitOptions rwOptions) |
void |
Saves the root nodes. |
WritePropertiesToJsonAsync(JsonWriter writer, BitOptions rwOptions) |
Task |
Saves content of the query to JSON (asynchronous way). |