This commit is contained in:
John Estropia
2026-07-24 11:51:36 +09:00
parent 1ea9ad7c4a
commit 13093d72d4
51 changed files with 1083 additions and 243 deletions
+37
View File
@@ -103,6 +103,26 @@ public nonisolated final class SynchronousDataTransaction: BaseDataTransaction {
return super.edit(object)
}
/**
Returns an editable proxy of the object with the specified `DynamicObjectID`.
- parameter into: an `Into` clause specifying the entity type
- parameter persistentID: the `DynamicObjectID` for the object to be edited
- returns: an editable proxy for the specified `NSManagedObject` or `CoreStoreObject`.
*/
public override func edit<O>(
_ into: Into<O>,
_ persistentID: DynamicObjectID<O>
) -> O? {
Internals.assert(
!self.isCommitted,
"Attempted to update an entity of type \(Internals.typeName(into.entityClass)) from an already committed \(Internals.typeName(self))."
)
return super.edit(into, persistentID)
}
/**
Returns an editable proxy of the object with the specified `NSManagedObjectID`.
@@ -122,6 +142,23 @@ public nonisolated final class SynchronousDataTransaction: BaseDataTransaction {
return super.edit(into, objectID)
}
/**
Deletes the objects with the specified `NSManagedObjectID`s.
- parameter objectIDs: the `NSManagedObjectID`s of the objects to delete
*/
public override func delete<O: DynamicObject, S: Sequence>(
persistentIDs: S
) where S.Iterator.Element == DynamicObjectID<O> {
Internals.assert(
!self.isCommitted,
"Attempted to delete an entities from an already committed \(Internals.typeName(self))."
)
super.delete(persistentIDs: persistentIDs)
}
/**
Deletes the objects with the specified `NSManagedObjectID`s.