I have modified an Entity and an Entity of a referenced Many Valued Association.
TParent = class
private
FName: string;
[ManyValuedAssociation([TAssociationProp.Lazy], CascadeTypeAllRemoveOrphan]
FChildren: Proxy<TList<TChild>>;
...
hParent := hObjMan.Find<TParent>(1).UniqueResult;
hParent.Name := 'Test';
hParent.Children[0].Name := 'Test2';
hObjMan.Refresh(hParent);
so hParent.Children[0].Name will stay Test2...
Checking hObjMan.HasChanges will return true afterwards, because hParent.Children[0] was not refreshed...
wlandgraf
(Wagner Landgraf)
September 28, 2023, 5:40pm
2
It's by design., Please refer to:
I have an Entity with a lazy loaded association. The underlying data in the database gets updated.
According to the docs: "Note that when refreshing an object that has lazy-loaded associations , the proxy is
updated and not immediately loaded. When the associated object (or list) is then
read, Aurelius will try to load the objects and if they are in the cache, they
will not be updated. This means if you have lazy-loaded association, specially
lists, and you want the list objects to be refr…
system
(system)
Closed
October 2, 2023, 8:17am
3
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.