extra extra type safety for attributes (fetching and importing)

This commit is contained in:
John Estropia
2017-02-17 14:13:16 +09:00
parent d2fd03c1f0
commit 9d5e04854a
10 changed files with 744 additions and 637 deletions

View File

@@ -87,7 +87,9 @@ public final class CSWhere: NSObject, CSFetchClause, CSQueryClause, CSDeleteClau
@objc
public convenience init(keyPath: KeyPath, isEqualTo value: CoreDataNativeType?) {
self.init(Where(keyPath, isEqualTo: value))
self.init(value == nil || value is NSNull
? Where("\(keyPath) == nil")
: Where("\(keyPath) == %@", value!))
}
/**
@@ -99,7 +101,7 @@ public final class CSWhere: NSObject, CSFetchClause, CSQueryClause, CSDeleteClau
@objc
public convenience init(keyPath: KeyPath, isMemberOf list: [CoreDataNativeType]) {
self.init(Where(keyPath, isMemberOf: list))
self.init(Where("\(keyPath) IN %@", list as NSArray))
}
/**