Concept class

Inheritance
Implementers

Constructors

Concept(Model model, String conceptCode)

Properties

abstract bool
getter/setter pair
attributes Attributes
getter/setter pair
canAdd bool
getter/setter pair
childCodeInternalPaths List<String>
no setter
children Children
getter/setter pair
code String
An optional human-readable string code identifying the entity. If null, defaults to 'code'. If concept says updateCode is false, cannot update.
getter/setter pairinherited-getteroverride-setter
codeFirstLetterLower String
Utility property returning the code's first letter in lowercase.
no setterinherited
codeFirstLetterUpper String
Utility property returning the code's first letter in uppercase.
no setterinherited
codeLowerSpace String
Utility property returning the code in lower space-separated form.
no setterinherited
codeLowerUnderscore String
Utility property returning the code in lower_snake_case form.
no setterinherited
codePlural String
Utility property returning the code in plural form.
no setterinherited
codePluralFirstLetterLower String
Utility property returning the plural code, first letter lowercased.
no setterinherited
codePluralFirstLetterUpper String
Utility property returning the plural code, first letter uppercased.
no setterinherited
codePluralFirstLetterUpperSpace String
Utility property returning the plural code in a spaced form with uppercase first letter.
no setterinherited
codePluralLowerUnderscore String
Utility property returning the plural code in lower_snake_case.
no setterinherited
codes String
getter/setter pair
codesFirstLetterLower String
getter/setter pair
codesLowerUnderscore String
getter/setter pair
concept Concept
The Concept describing the domain structure for this entity. If _concept is null, throws EDNetException.
getter/setter pairinherited
description String
getter/setter pair
entry bool
getter/setter pair
entryConcept Concept
no setter
entryConceptThisConceptInternalPath String?
no setter
essentialAttributes List<Attribute>
no setter
exceptions IValidationExceptions
Accumulates validation or policy violation exceptions. Each time entity updates happen, exceptions may record domain errors.
getter/setter pairinherited
externalParents List<Parent>
no setter
externalRequiredParents List<Parent>
no setter
hasAttributeId bool
no setter
hashCode int
Hashes the entity by its oid.
no setteroverride
hasId bool
no setter
hasParentId bool
no setter
hasReflexiveChild bool
no setter
hasReflexiveParent bool
no setter
hasTwinChild bool
no setter
hasTwinParent bool
no setter
id Id
The Id aggregates all identifier attributes or parent references. If the concept has none, returns null.
no setteroverride
identifierAttributes List<Attribute>
no setter
incrementAttributes List<Attribute>
no setter
internalChildren List<Child>
no setter
label String?
getter/setter pair
labels String?
getter/setter pair
max String
getter/setter pair
min String
getter/setter pair
model Model
getter/setter pair
nonIdentifierAttributes List<Attribute>
no setter
nonIncrementAttributes List<Attribute>
no setter
oid Oid
Unique object identifier (OID) for the entity. By default, this is assigned on creation, but can be changed if concept.updateOid is true.
getter/setter pairinherited
parents Parents
getter/setter pair
policyEvaluator PolicyEvaluator
Allows external configuration of the PolicyEvaluator.
no getterinherited
post bool
getter/setter pairinherited
pre bool
Hooks to control pre/post conditions on attribute/relationship changes. pre indicates if we do pre-validation logic, post for post-validation.
getter/setter pairinherited
remove bool
getter/setter pair
requiredAttributes List<Attribute>
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
singleValueProperties List<Property>
no setter
sourceChildren Children
getter/setter pair
sourceParents Parents
getter/setter pair
updateCode bool
getter/setter pair
updateOid bool
getter/setter pair
updateWhen bool
getter/setter pair
whenAdded DateTime?
Timestamp of when the entity was first created or added. Only updatable if concept.updateWhen is true.
getter/setter pairinherited
whenRemoved DateTime?
Timestamp of when the entity was logically removed. Only updatable if concept.updateWhen is true.
getter/setter pairinherited
whenSet DateTime?
Timestamp of the latest attribute or relationship update. Used for partial concurrency or auditing.
getter/setter pairinherited

Methods

compareAttributes(Concept entity) int
Compare attributes one by one until a difference is found. Return negative if this < that; zero if same; positive if this > that.
inherited
compareTo(dynamic entity) int
Compare two entities, primarily using code, otherwise id, otherwise attribute comparisons. If negative, this < that; zero => equal; positive => this > that.
inherited
copy() Concept
Creates a shallow copy of this entity. OID, code, attributes, and references are duplicated. Child/parent references are not deeply cloned but re-linked.
inherited
display({String prefix = '', bool withOid = true, bool withChildren = true, bool withInternalChildren = true}) → void
Displays this entity’s details, including attributes, parents, children.
inherited
displayToString() → void
Prints toString().
inherited
equalContent(Concept entity) bool
Checks if the content (attributes, code, parents, children) matches another entity. Ignores oid, whenAdded, whenSet, whenRemoved.
inherited
equals(Concept concept) bool
Two concepts are equal if their oids are equal.
override
evaluatePolicies({String? policyKey}) PolicyEvaluationResult
Evaluates entity-level and model-level policies for this entity. If a policyKey is provided, only that specific policy is evaluated.
inherited
fromJson<K extends Entity<K>>(String entityJson) → void
Populates this entity's data from a JSON string. Deserializes via fromJsonMap.
inherited
fromJsonMap(dynamic entityMap, [Entity<Entity>? internalParent]) → void
Internal: loads entity data from a map entityMap, optionally linking to an internalParent.
inherited
getAttribute<Attribute>(String attributeCode) → Attribute?
Retrieves the attribute value for attributeCode as type K. Returns null if not set.
override
getChild(String? name) Object?
Retrieves the child collection matching name. Or null if no such child is defined.
inherited
getDestinationChild(String childCode) Child?
getDestinationParent(String parentCode) Parent?
getInternalChild(String name) Object?
Gets the internal child collection reference by name.
inherited
getParent(String name) Object?
Gets the parent entity by name, or null if none.
inherited
getReference(String name) Reference?
Returns the Reference to a parent by name, if any.
inherited
getRelationship(String relationshipName) → dynamic
Retrieves either a parent or child relationship by name. Returns null if neither is found.
inherited
getSourceChild(String childCode) Child?
getSourceParent(String parentCode) Parent?
getStringFromAttribute(String name) String?
Returns the attribute value as a string. If the value is null, returns 'null'.
inherited
getStringOrNullFromAttribute(String name) String?
Returns the attribute value as a nullable string, or null if no value.
inherited
isAttributeSensitive(String attributeCode) bool
isChild(String relationshipName) → dynamic
isChildSensitive(String childCode) bool
isParent(String relationshipName) → dynamic
isParentSensitive(String parentCode) bool
isPropertySensitive(String propertyCode) bool
newEntities() Entities<Concept>
Creates a new Entities<E> collection that can hold instances of this entity. The new collection references the same Concept.
inherited
newEntity() Entity<Concept>
Creates a new empty instance of this entity type. The returned entity has the same Concept as the original.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
postSetAttribute(String name, Object? value) bool
Called after setting an attribute. If post is true, can run additional checks. Return false if you want to revert the update.
inherited
preSetAttribute(String name, Object? value) bool
Called before setting an attribute. If pre is true, can run additional checks. If returns false, attribute set operation is not performed.
inherited
removeParent(String name) → dynamic
Removes a parent reference by name, if parent.update is true. Reverts if policies are violated.
inherited
setAttribute(String name, Object? value) bool
Sets an attribute by name to value, respecting update rules and calling policy checks. Returns true if the attribute was successfully updated. Throws UpdateException if the attribute is not updatable or absent. Also handles policy checks, reverting changes if policies fail.
inherited
setAttributesFrom(Entity<Entity> entity) bool
Bulk-updates this entity’s attributes from another entity if whenSet is older. Only non-identifier attributes are considered. Returns true if all updated.
inherited
setChild(String name, Object entities) bool
Updates a child relationship name with entities. If child.update is false, we throw an UpdateException. If policies fail, we revert.
inherited
setParent(String name, dynamic entity) bool
Sets or updates a parent relationship named name with the given entity. If parent is uninitialized or updatable, we store a reference. If policies fail, we revert.
inherited
setReference(String name, Reference reference) → void
Sets a Reference for a parent name, but only if that parent slot is empty.
inherited
setStringToAttribute(String name, String string) bool
Helper to parse a string and update the attribute name accordingly. If the attribute type is recognized (e.g., int, bool), we parse the string. Otherwise, store the string as-is.
inherited
toGraph() Map<String, dynamic>
Converts this entity to a graph-like structure, including references to parents.
override
toJson() String
Serializes this entity to JSON using toJsonMap.
inherited
toJsonMap() Map<String, Object>
Builds a JSON-like Map of this entity's data, including parent references.
inherited
toString() String
Returns a concise string representation using the entity's oid and code.
inherited

Static Methods

safeGetConcept(Model model, Entity<Entity> entity, {Concept? defaultValue}) Concept