Skip to content

DataModel class

Represents a data model

public class Korzh.EasyQuery.DataModel
TypeNameDescription
AggrFunctionListAggrFunctionsList of aggregate functions.
StringcustomInfoUser-defined additional information about the model
StringdefQueryFilePathFile path for default query
StringdescriptionDescription of the model
Dictionary<String, String>DMEOptionsA dictionary that contains different Data Model Editor options associated with this model
EntityentityRootMain entity of the model
StringfilePathRepresents model file location, if model is loaded from file
Int32formatVersionFormat version of data model definition files
MacroListMacrosList of macro values
Int32maxEntAttrIDNumber of virtual attributes
StringmodelNameUser-defined name of the model
Int32modelVersionVersion of the model
BooleanuseResourcesForOperatorsIndicates whether resources will be used for getting caption and format of the Korzh.EasyQuery.Operator
TypeNameDescription
StringCustomInfoGets or sets the custom information associated with data model.
ValueEditorDefaultPreciseDateEditorGets the default “precise date” editor.
ValueEditorDefaultPreciseTimeEditorGets the default “precise time” editor.
ValueEditorDefaultTextEditorGets the default text editor.
StringDefQueryFilePathGets or sets the file path for default (blank) query used with this data model.
StringDescriptionGets or sets the description.
ValueEditorsListEditorsList of data model operators.
EntityGraphEntityGraph
EntityEntityRootThe root entity of data model entities.
StringFilePathGets the model file path. It is automatically assigned when you use LoadFromFile method.
Int32FormatVersionGets the version of data model format.
StringIDGets or sets the ID of the model.
BooleanIsEmptyGets a value indicating whether this model is empty (doesn’t contain any entity or attribute) or not.
StringModelNameGets or sets the user-defined name of the model.
Int32ModelVersionGets the model version.
EntityAttrNullAttributeGets the Null or “unrecognized” attribute.
OperatorNullOperatorGets the null operator.
OperatorListOperatorsList of data model operators.
IProgressIndicatorProgressIndicatorGets or sets the progress indicator object. This property is used to show progress for some time consuming operations performed inside model
TextStorageTextsGets an instance of TextStorage object which holds all text resources used in this assembly
BooleanUseResourcesForOperatorsGets or sets a value indicating whether we get the main parameters (caption and format) for default operators from resources.
TypeNameDescription
AggrFuncListChangedEventHandlerAggrFuncListChangedOccurs when the list of available aggregate functions was changed.
MacroRequestEventHandlerMacroRequestThis event is raised when a value for some macro is requested.
EventHandlerModelChangedOccurs when the model is changed.
TypeNameDescription
voidAddDefaultEditors()Adds the default value editors.
voidAddDefaultOperators()Adds the default operators into model
voidAddOperatorToEntity(Operator op, Entity ent)Adds the operator to all suitable attributes in specified entity.
voidAddOperatorToSuitedAttributes(Operator op)Adds the operator to all suitable (by data type) attributes.
OperatorAddUpdateOperator(String id, String caption, String expr, String format, DataKind kind = Scalar, OperatorGroup group = null)Adds or update an operator.
voidAssignEntityAttrID(EntityAttr attr)Assigns the default ID for entity attribute.
voidClear()Clears this instance.
DataModelClone()
EntityCreateEntity()Creates the entity.
EntityAttrCreateEntityAttr()Creates the entity attribute. Used for creating entity attributes while building the model
EntityAttrCreateGhostAttribute(String id)
EntityAttrCreateNullAttribute()Creates the Null attribute.
OperatorCreateNullOperator()Creates the null operator. U
OperatorCreateOperator()Creates the operator. Used for creating objects while building the model
OperatorCreateOperator(String id, String caption, String expr, String format)Creates the operator. Used for creating objects while building the model
EntityCreateRootEntity()Creates the root entity. This method can be overriden in descendant classes to retrun the object of appropriate class (e.g. DbEntity).
voidDeleteOperator(Operator op)Deletes the operator from the model.
voidDeleteOperatorFromEntity(Entity ent, Operator op)Deletes the operator from any attribute of specified entity (and all its sub-entities).
voidEnsureEditorExistance(ValueEditor editor)Ensures the existance of value editor.
EntityFindEntity(String entityName)Finds an entity by its name.
EntityAttrFindEntityAttr(String attrDef)Find attribute either by its ID, expression or caption.
EntityAttrGetAttributeByID(String attrID, Boolean useNullAttr)Gets the attribute by its ID.
OperatorListGetDefaultOperatorsForDataType(DataType dataType)Returns the list of default operators for some data type
EntityAttrGetDefaultUICAttribute()Returns the first attribute in the Root entity with UseInConditions set to true. This attribute is shown by default for new condition.
EntityAttrGetDefaultUIRAttribute()Returns the first attribute in the Root entity with UseInResult set to true. This attribute is shown by default for new column.
EntityAttrGetDefaultUIRAttribute(Boolean needUseInSorting)Returns the first attribute in the Root entity with UseInResult set to true. This attribute is shown by default for new column.
IMacroValueGetMacroValue(String macroId)Gets the value of macro by its ID.
Int32GetNextEntityAttrID()Gets the next free number for building virtual entity attribute ID.
voidIncreaseModelVersion()Increases the model version.
voidInitModelLoading()Inits the model loading.
voidListDefaultOperatorsForDataType(OperatorList operats, DataType dataType)Fills the list with default operators for some data type
voidLoadFromFile(String path)Loads data model from file.
voidLoadFromFile(String path, RWOptions rwOptions)Loads data model from file.
voidLoadFromStream(Stream stream)Loads data model from stream.
voidLoadFromStream(Stream stream, RWOptions rwOptions)Loads data model from stream.
voidLoadFromString(String xml, RWOptions rwOptions)Loads data model from string.
voidLoadFromString(String xml)Loads data model from string.
voidLoadFromXmlReader(XmlReader reader)Loads data model from XML reader.
voidLoadFromXmlReader(XmlReader reader, RWOptions rwOptions)Loads data model from XML reader.
voidLoadModelAtrributesFromXmlReader(XmlReader reader)Loads data model’s attributes from the main XML node (DataModel)
voidLoadNode(XmlReader reader, RWOptions rwOptions)Loads the root node of the model. Can be overriden for loading additional root nodes in Korzh.EasyQuery.DataModel’s descendants
voidLoadOneModelAtrributeFromXmlReader(XmlReader reader)Processes one data model’s attribute from the main XML node (DataModel)
StringLoadValueEditorNode(ValueEditor editor, XmlReader reader)Loads the value editor definition from XML.
voidOnAggrFuncListChanged()Raises the AggrFuncListChanged event.
BooleanOnMacroRequest(MacroRequestEventArgs e)Raises the MacroRequest event.
voidOnModelChanged()Called after the model has been changed. Raises ModelChanged event if defined.
voidOnModelLoaded()Called when the model is loaded (from XML file or string).
voidRefillAggrFunctionList()Refills the list of aggregate functions.
voidRefreshResources()Re-loads the string values from Korzh.EasyQuery.DataModel.Texts list.
voidSaveAttributes(XmlWriter writer, RWOptions options)Saves the attributes of the model. Can be overriden for storing additional attributes
voidSaveCustomInfoNode(XmlWriter writer)Saves the custom info node.
voidSaveNodes(XmlWriter writer, RWOptions options)Saves the root nodes of the model. Can be overriden for storing additional nodes
voidSaveToFile(String path)Saves data model to file.
voidSaveToFile(String path, RWOptions options)Saves data model to file.
JsonDictSaveToJsonDict()Saves the model into Dictionary object. Useful for JSON serialization.
voidSaveToStream(Stream stream)Saves data model XML to stream.
voidSaveToStream(Stream stream, RWOptions options)Saves data model XML to stream.
StringSaveToString()Saves data model specification to string object.
StringSaveToString(RWOptions options)Saves data model specification to string object.
voidSaveToXmlWriter(XmlWriter writer)Saves data model specification using XmlWriter.
voidSaveToXmlWriter(XmlWriter writer, RWOptions options)Saves data model specification using XmlWriter.
voidSetProgress(Int32 pos)Set the progress to the specified position.
voidSetProgressMinMax(Int32 min, Int32 max)Sets the minimum and maximum of progress indicator.
voidSortEntities()Sorts all entities and their attributes alphabetically.
voidSortEntityContent(Entity entity)Sorts the content of one entity alphabetically. This function is called by Korzh.EasyQuery.DataModel.SortEntities method
voidUpdateOperatorsTexts()Loads the text for all default operators from resources.
voidUpdateOperatorTexts(Operator op)Loads the texts for one operator from resources (Texts storage actually)
TypeNameDescription
OperatorGroupAnyOperatorGroupGets the special group which contain any operator
OperatorGroupBoolOperatorGroupGets the group which contains the date/time operators (before, after, between, etc.)
OperatorGroupCommonOperatorGroupGets the group which contains the common operators (equal, not equal, less than, more than, etc)
Int32LastFormatVersionRead-only constant that represent the latest format version of data model definition files
OperatorGroupListOperatorGroupsGets the list of all predefined operator groups
OperatorGroupOtherOperatorGroupGets the group which contains other operators not included in any of the previous group
OperatorGroupStringOperatorGroupGets the group which contains the string operators (starts with, contains)
OperatorGroupTimeOperatorGroupGets the group which contains the date/time operators (before, after, between, etc.)