Skip to content

Predicate class

Represents group of conditions linked by some logical operator (AND or OR).

public abstract class Korzh.EasyQuery.Predicate
: Condition
TypeNameDescription
Boolean_isRoot
TypeNameDescription
ConditionsStoreConditionsGets the conditions.
BooleanIsEmptyGets a value indicating whether this predicate is empty (zero conditions).
BooleanIsRootGets a value indicating whether this predicate is the root predicate in query.
LinkTypeLinkingGets or sets the linking type.
StringLinkingStrGets or sets the text representation of linking type.
StringTypeNameGets the name of the condition type. The same as STypeName but works for one particular instance of SimpleCondition class.
TypeNameDescription
PredicateAddPredicate(LinkType lnkType)Creates and adds a new predicate into current
SimpleConditionAddSimpleCondition(String attrId, String operatorId, String[] values)Adds a simple condition by attribute ID, operator ID and a list of values
SimpleConditionAddSimpleCondition(EntityAttr attr, Operator op, EqExpression[] exprs)Adds a simple condition by attribute ID, operator ID and a list of values
voidBeginUpdate()Starts the update process. OnConditionsChanged event of corresponding Query object is not raised while condition is in update state
voidCheckIfEnabled()This procedure is called when Enable state in one of the child conditions was changed.
BooleanContainsGhosts(Condition& outCond)Determines whether this predicate contains a condition with a “ghost” attribute.
voidEndUpdate()Ends the update process. Raises ConditionsChange event if some modification(s) was(were) made during update process.
ConditionFindCondByAttr(EntityAttr attr)Finds the condition the by entity attribute set in the left part of this condition.
BooleanGetHaving()Gets a value indicating whether this condition must be placed into HAVING clause in result SQL.
Int32GetOffspringCount()Gets the number of all offspings of the predicate
StringGetPredicateHeader()Gets the predicate header text.
StringGetText(QueryTextFormats formats, String levelSpace, String prefix)Returns text representation of condition
IEnumerable<Entity>GetUsedEntities()Gets the list of entities that are used in conditions of this predicate.
voidLoadFromJsonDict(JsonDict dictPredicate)Loads condition from IDictionary. Used during loading query from JSON
voidLoadFromXmlReader(XmlReader reader)Loads Korzh.EasyQuery.Predicate properties from XML reader.
voidReset()Clears the condition list and resets linking type
voidSaveToXmlWriter(XmlWriter writer)Saves root condition group object to XML writer, if the predicate is root. Otherwise calls inherited method.
voidSetEnabled(Boolean newValue)Sets the Enabled property.
voidSetQuery(Query newQuery)Sets the query object.
voidSetReadOnly(Boolean newValue)Sets the ReadOnly property.
voidWriteContent(XmlWriter writer)Writes the content of condition to XmlWriter object.
voidWriteSubNodesToXml(XmlWriter writer)Writes the sub codnitions to XML.
TypeNameDescription
StringSTypeNameGets the name of the S class.