pub struct EntityRoot { /* private fields */ }Implementations§
Source§impl EntityRoot
impl EntityRoot
pub fn push_change_set(&self)
pub fn pop_change_set(&self) -> Option<EntityChangeSet>
pub fn clear_current_change_set(&self)
pub fn set( &self, key: EntityKey, field: impl Into<String>, value: impl Into<Value>, )
pub fn get(&self, key: &EntityKey, field: &str) -> Option<Value>
pub fn current_change_set(&self) -> EntityChangeSet
Sourcepub fn set_comment(&self, comment: impl Into<String>)
pub fn set_comment(&self, comment: impl Into<String>)
Set an annotation comment on this entity root. The comment propagates through the graph save process for observability.
Sourcepub fn get_comment(&self) -> Option<String>
pub fn get_comment(&self) -> Option<String>
Get the annotation comment, if any.
Sourcepub fn mark_as_new(&self, key: EntityKey)
pub fn mark_as_new(&self, key: EntityKey)
Mark this entity root as a newly created entity in memory.
Sourcepub fn is_new(&self, key: &EntityKey) -> bool
pub fn is_new(&self, key: &EntityKey) -> bool
Check if this entity root is marked as newly created.
Sourcepub fn set_original_record(&self, record: Record)
pub fn set_original_record(&self, record: Record)
Store the original record when loaded from DB.
Sourcepub fn original_record(&self) -> Option<Record>
pub fn original_record(&self) -> Option<Record>
Retrieve the original record.
Sourcepub fn mark_as_delete(&self, key: EntityKey)
pub fn mark_as_delete(&self, key: EntityKey)
Mark an entity as deleted. The next save() call will treat this entity
as a Remove operation in the graph save pipeline.
Any pending field changes for this entity are cleared — they are irrelevant
when the entity is being deleted.
Sourcepub fn is_marked_as_delete(&self, key: &EntityKey) -> bool
pub fn is_marked_as_delete(&self, key: &EntityKey) -> bool
Check whether an entity has been marked for deletion.
Sourcepub fn changed_field_names(&self, key: &EntityKey) -> BTreeSet<String>
pub fn changed_field_names(&self, key: &EntityKey) -> BTreeSet<String>
Get the set of field names that have been modified for the given entity key.
This is the Rust equivalent of Java’s entity.getUpdatedProperties().
pub fn deleted_keys(&self) -> BTreeSet<EntityKey>
pub fn new_keys(&self) -> BTreeSet<EntityKey>
pub fn get_original_version(&self, key: &EntityKey) -> Option<i64>
pub fn get_trace_chain(&self, key: &EntityKey) -> Vec<TraceNode>
pub fn set_original_version(&self, key: EntityKey, version: i64)
Trait Implementations§
Source§impl Clone for EntityRoot
impl Clone for EntityRoot
Source§fn clone(&self) -> EntityRoot
fn clone(&self) -> EntityRoot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more