CSBaseDataTransaction
@objc
public class CSBaseDataTransaction : NSObject
The CSBaseDataTransaction serves as the Objective-C bridging type for BaseDataTransaction.
See also
BaseDataTransaction
-
Indicates if the transaction has pending changes
Declaration
Swift
@objc public var hasChanges: Bool { get } -
Creates a new
NSManagedObjectwith the specified entity type.Declaration
Swift
@objc public func createInto(_ into: CSInto) -> AnyParameters
intothe
CSIntoclause indicating the destinationNSManagedObjectentity type and the destination configurationReturn Value
a new
NSManagedObjectinstance of the specified entity type. -
Returns an editable proxy of a specified
NSManagedObject.Declaration
Swift
@objc public func editObject(_ object: NSManagedObject?) -> Any?Parameters
objectthe
NSManagedObjecttype to be editedReturn Value
an editable proxy for the specified
NSManagedObject. -
Returns an editable proxy of the object with the specified
NSManagedObjectID.Declaration
Swift
@objc public func editInto(_ into: CSInto, objectID: NSManagedObjectID) -> Any?Parameters
intoa
CSIntoclause specifying the entity typeobjectIDthe
NSManagedObjectIDfor the object to be editedReturn Value
an editable proxy for the specified
NSManagedObject. -
Deletes a specified
NSManagedObject.Declaration
Swift
@objc public func deleteObject(_ object: NSManagedObject?)Parameters
objectthe
NSManagedObjectto be deleted -
Deletes the specified
NSManagedObjects.Declaration
Swift
@objc public func deleteObjects(_ objects: [NSManagedObject])Parameters
objectsthe
NSManagedObjects to be deleted -
Refreshes all registered objects
NSManagedObjects in the transaction.Declaration
Swift
@objc public func refreshAndMergeAllObjects()
-
Returns all pending
NSManagedObjects of the specified type that were inserted to the transaction. This method should not be called after the-commit*:method was called.Declaration
Swift
@objc public func insertedObjectsOfType(_ entity: NSManagedObject.Type) -> Set<NSManagedObject>Parameters
entitythe
NSManagedObjectsubclass to filterReturn Value
an
NSSetof pendingNSManagedObjects of the specified type that were inserted to the transaction. -
Returns all pending
NSManagedObjectIDs that were inserted to the transaction. This method should not be called after the-commit*:method was called.Declaration
Swift
@objc public func insertedObjectIDs() -> Set<NSManagedObjectID>Return Value
an
NSSetof pendingNSManagedObjectIDs that were inserted to the transaction. -
Returns all pending
NSManagedObjectIDs of the specified type that were inserted to the transaction. This method should not be called after the-commit*:method was called.Declaration
Swift
@objc public func insertedObjectIDsOfType(_ entity: NSManagedObject.Type) -> Set<NSManagedObjectID>Parameters
entitythe
NSManagedObjectsubclass to filterReturn Value
an
NSSetof pendingNSManagedObjectIDs of the specified type that were inserted to the transaction. -
Returns all pending
NSManagedObjects of the specified type that were updated in the transaction. This method should not be called after the-commit*:method was called.Declaration
Swift
@objc public func updatedObjectsOfType(_ entity: NSManagedObject.Type) -> Set<NSManagedObject>Parameters
entitythe
NSManagedObjectsubclass to filterReturn Value
an
NSSetof pendingNSManagedObjects of the specified type that were updated in the transaction. -
Returns all pending
NSManagedObjectIDs that were updated in the transaction. This method should not be called after the-commit*:method was called.Declaration
Swift
@objc public func updatedObjectIDs() -> Set<NSManagedObjectID>Return Value
an
NSSetof pendingNSManagedObjectIDs that were updated in the transaction. -
Returns all pending
NSManagedObjectIDs of the specified type that were updated in the transaction. This method should not be called after the-commit*:method was called.Declaration
Swift
@objc public func updatedObjectIDsOfType(_ entity: NSManagedObject.Type) -> Set<NSManagedObjectID>Parameters
entitythe
NSManagedObjectsubclass to filterReturn Value
an
NSSetof pendingNSManagedObjectIDs of the specified type that were updated in the transaction. -
Returns all pending
NSManagedObjects of the specified type that were deleted from the transaction. This method should not be called after the-commit*:method was called.Declaration
Swift
@objc public func deletedObjectsOfType(_ entity: NSManagedObject.Type) -> Set<NSManagedObject>Parameters
entitythe
NSManagedObjectsubclass to filterReturn Value
an
NSSetof pendingNSManagedObjects of the specified type that were deleted from the transaction. -
Returns all pending
NSManagedObjectIDs of the specified type that were deleted from the transaction. This method should not be called after the-commit*:method was called.Declaration
Swift
@objc public func deletedObjectIDs() -> Set<NSManagedObjectID>Return Value
an
NSSetof pendingNSManagedObjectIDs of the specified type that were deleted from the transaction. -
Returns all pending
NSManagedObjectIDs of the specified type that were deleted from the transaction. This method should not be called after the-commit*:method was called.Declaration
Swift
@objc public func deletedObjectIDsOfType(_ entity: NSManagedObject.Type) -> Set<NSManagedObjectID>Parameters
entitythe
NSManagedObjectsubclass to filterReturn Value
a
Setof pendingNSManagedObjectIDs of the specified type that were deleted from the transaction.
-
Fetches the
NSManagedObjectinstance in the transaction’s context from a reference created from a transaction or from a different managed object context.Declaration
Swift
@objc public func fetchExistingObject(_ object: NSManagedObject) -> Any?Parameters
objecta reference to the object created/fetched outside the transaction
Return Value
the
NSManagedObjectinstance if the object exists in the transaction, ornilif not found. -
Fetches the
NSManagedObjectinstance in the transaction’s context from anNSManagedObjectID.Declaration
Swift
@objc public func fetchExistingObjectWithID(_ objectID: NSManagedObjectID) -> Any?Parameters
objectIDthe
NSManagedObjectIDfor the objectReturn Value
the
NSManagedObjectinstance if the object exists in the transaction, ornilif not found. -
Fetches the
NSManagedObjectinstances in the transaction’s context from references created from a transaction or from a different managed object context.Declaration
Swift
@objc public func fetchExistingObjects(_ objects: [NSManagedObject]) -> [Any]Parameters
objectsan array of
NSManagedObjects created/fetched outside the transactionReturn Value
the
NSManagedObjectarray for objects that exists in the transaction -
Fetches the
NSManagedObjectinstances in the transaction’s context from a list ofNSManagedObjectID.Declaration
Swift
@objc public func fetchExistingObjectsWithIDs(_ objectIDs: [NSManagedObjectID]) -> [Any]Parameters
objectIDsthe
NSManagedObjectIDarray for the objectsReturn Value
the
NSManagedObjectarray for objects that exists in the transaction -
Fetches the first
NSManagedObjectinstance that satisfies the specifiedCSFetchClauses. AcceptsCSWhere,CSOrderBy, andCSTweakclauses.Declaration
Swift
@objc public func fetchOneFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> Any?Parameters
froma
Fromclause indicating the entity typefetchClausesa series of
CSFetchClauseinstances for the fetch request. AcceptsCSWhere,CSOrderBy, andCSTweakclauses.Return Value
the first
NSManagedObjectinstance that satisfies the specifiedCSFetchClauses -
Fetches all
NSManagedObjectinstances that satisfy the specifiedCSFetchClauses. AcceptsCSWhere,CSOrderBy, andCSTweakclauses.Declaration
Swift
@objc public func fetchAllFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> [Any]?Parameters
froma
CSFromclause indicating the entity typefetchClausesa series of
CSFetchClauseinstances for the fetch request. AcceptsCSWhere,CSOrderBy, andCSTweakclauses.Return Value
all
NSManagedObjectinstances that satisfy the specifiedCSFetchClauses -
Fetches the number of
NSManagedObjects that satisfy the specifiedCSFetchClauses. AcceptsCSWhere,CSOrderBy, andCSTweakclauses.Declaration
Swift
@objc public func fetchCountFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> NSNumber?Parameters
froma
CSFromclause indicating the entity typefetchClausesa series of
CSFetchClauseinstances for the fetch request. AcceptsCSWhere,CSOrderBy, andCSTweakclauses.Return Value
the number
NSManagedObjects that satisfy the specifiedCSFetchClauses -
Fetches the
NSManagedObjectIDfor the firstNSManagedObjectthat satisfies the specifiedCSFetchClauses. AcceptsCSWhere,CSOrderBy, andCSTweakclauses.Declaration
Swift
@objc public func fetchObjectIDFrom(_ from: CSFrom, fetchClauses: [CSFetchClause]) -> NSManagedObjectID?Parameters
froma
CSFromclause indicating the entity typefetchClausesa series of
CSFetchClauseinstances for the fetch request. AcceptsCSWhere,CSOrderBy, andCSTweakclauses.Return Value
the
NSManagedObjectIDfor the firstNSManagedObjectthat satisfies the specifiedCSFetchClauses -
Queries aggregate values as specified by the
CSQueryClauses. Requires at least aCSSelectclause, and optionalCSWhere,CSOrderBy,CSGroupBy, andCSTweakclauses.A
query
differs from afetch
in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.Declaration
Swift
@objc public func queryValueFrom(_ from: CSFrom, selectClause: CSSelect, queryClauses: [CSQueryClause]) -> Any?Parameters
froma
CSFromclause indicating the entity typeselectClausea
CSSelectclause indicating the properties to fetch, and with the generic type indicating the return type.queryClausesa series of
CSQueryClauseinstances for the query request. AcceptsCSWhere,CSOrderBy,CSGroupBy, andCSTweakclauses.Return Value
the result of the the query. The type of the return value is specified by the generic type of the
CSSelectparameter. -
Queries a dictionary of attribute values as specified by the
CSQueryClauses. Requires at least aCSSelectclause, and optionalCSWhere,CSOrderBy,CSGroupBy, andCSTweakclauses.A
query
differs from afetch
in that it only retrieves values already stored in the persistent store. As such, values from unsaved transactions or contexts will not be incorporated in the query result.Declaration
Swift
@objc public func queryAttributesFrom(_ from: CSFrom, selectClause: CSSelect, queryClauses: [CSQueryClause]) -> [[String : Any]]?Parameters
froma
CSFromclause indicating the entity typeselectClausea
CSSelectclause indicating the properties to fetch, and with the generic type indicating the return type.queryClausesa series of
CSQueryClauseinstances for the query request. AcceptsCSWhere,CSOrderBy,CSGroupBy, andCSTweakclauses.Return Value
the result of the the query. The type of the return value is specified by the generic type of the
CSSelectparameter.
View on GitHub
CSBaseDataTransaction Class Reference