CSSelectTerm
@objc
public final class CSSelectTerm : NSObject
The CSSelectTerm serves as the Objective-C bridging type for SelectTerm.
See also
SelectTerm
-
Provides a
CSSelectTermto aCSSelectclause for querying an entity attribute.NSString *fullName = [CSCoreStore queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]] select:CSSelectString(CSAttribute(@"fullname")) fetchClauses:@[[CSWhere keyPath:@"employeeID" isEqualTo: @1111]]];Declaration
Swift
@objc public convenience init(keyPath: KeyPathString)Parameters
keyPaththe attribute name
-
Provides a
CSSelectTermto aCSSelectclause for querying the average value of an attribute.NSNumber *averageAge = [CSCoreStore queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]] select:[CSSelect numberForTerm:[CSSelectTerm average:@"age" as:nil]]];Declaration
Swift
@objc public static func average(_ keyPath: KeyPathString, as alias: KeyPathString?) -> CSSelectTermParameters
keyPaththe attribute name
Return Value
a
CSSelectTermto aCSSelectclause for querying the average value of an attribute -
Provides a
CSSelectTermto aCSSelectclause for a count query.NSNumber *numberOfEmployees = [CSCoreStore queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]] select:[CSSelect numberForTerm:[CSSelectTerm count:@"employeeID" as:nil]]];Declaration
Swift
@objc public static func count(_ keyPath: KeyPathString, as alias: KeyPathString?) -> CSSelectTermParameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keycount(
is used) Return Value
a
SelectTermto aSelectclause for a count query -
Provides a
CSSelectTermto aCSSelectclause for querying the maximum value for an attribute.NSNumber *maximumAge = [CSCoreStore queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]] select:[CSSelect numberForTerm:[CSSelectTerm maximum:@"age" as:nil]]];Declaration
Swift
@objc public static func maximum(_ keyPath: KeyPathString, as alias: KeyPathString?) -> CSSelectTermParameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keymax(
is used) Return Value
a
CSSelectTermto aCSSelectclause for querying the maximum value for an attribute -
Provides a
CSSelectTermto aCSSelectclause for querying the minimum value for an attribute.NSNumber *minimumAge = [CSCoreStore queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]] select:[CSSelect numberForTerm:[CSSelectTerm minimum:@"age" as:nil]]];Declaration
Swift
@objc public static func minimum(_ keyPath: KeyPathString, as alias: KeyPathString?) -> CSSelectTermParameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keymin(
is used) Return Value
a
CSSelectTermto aCSSelectclause for querying the minimum value for an attribute -
Provides a
CSSelectTermto aCSSelectclause for querying the sum value for an attribute.NSNumber *totalAge = [CSCoreStore queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]] select:[CSSelect numberForTerm:[CSSelectTerm sum:@"age" as:nil]]];Declaration
Swift
@objc public static func sum(_ keyPath: KeyPathString, as alias: KeyPathString?) -> CSSelectTermParameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keysum(
is used) Return Value
a
CSSelectTermto aCSSelectclause for querying the sum value for an attribute -
Provides a
CSSelectTermto aCSSelectclause for querying theNSManagedObjectID.NSManagedObjectID *objectID = [CSCoreStore queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]] select:[CSSelect objectIDForTerm:[CSSelectTerm objectIDAs:nil]] fetchClauses:@[[CSWhere keyPath:@"employeeID" isEqualTo: @1111]]];Declaration
Swift
@objc public static func objectIDAs(_ alias: KeyPathString? = nil) -> CSSelectTermParameters
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keyobjecID
is usedReturn Value
a
SelectTermto aSelectclause for querying the sum value for an attribute
View on GitHub
CSSelectTerm Class Reference