WIP: query chains!

This commit is contained in:
John Rommel Estropia
2017-07-09 10:44:53 +09:00
parent aff966aac9
commit 535eb76adc
40 changed files with 1783 additions and 1004 deletions

View File

@@ -39,12 +39,12 @@ import CoreData
let person = transaction.create(Into<MyPersonEntity>("Configuration1"))
```
*/
public struct Into<T: DynamicObject>: Hashable {
public struct Into<D: DynamicObject>: Hashable {
/**
The associated `NSManagedObject` or `CoreStoreObject` entity class
*/
public let entityClass: T.Type
public let entityClass: D.Type
/**
The `NSPersistentStore` configuration name to associate objects from.
@@ -60,7 +60,7 @@ public struct Into<T: DynamicObject>: Hashable {
*/
public init() {
self.init(entityClass: T.self, configuration: nil, inferStoreIfPossible: true)
self.init(entityClass: D.self, configuration: nil, inferStoreIfPossible: true)
}
/**
@@ -70,7 +70,7 @@ public struct Into<T: DynamicObject>: Hashable {
```
- parameter entity: the `NSManagedObject` type to be created
*/
public init(_ entity: T.Type) {
public init(_ entity: D.Type) {
self.init(entityClass: entity, configuration: nil, inferStoreIfPossible: true)
}
@@ -84,7 +84,7 @@ public struct Into<T: DynamicObject>: Hashable {
*/
public init(_ configuration: ModelConfiguration) {
self.init(entityClass: T.self, configuration: configuration, inferStoreIfPossible: false)
self.init(entityClass: D.self, configuration: configuration, inferStoreIfPossible: false)
}
/**
@@ -95,7 +95,7 @@ public struct Into<T: DynamicObject>: Hashable {
- parameter entity: the `NSManagedObject` type to be created
- parameter configuration: the `NSPersistentStore` configuration name to associate the object to. This parameter is required if multiple configurations contain the created `NSManagedObject`'s entity type. Set to `nil` to use the default configuration.
*/
public init(_ entity: T.Type, _ configuration: ModelConfiguration) {
public init(_ entity: D.Type, _ configuration: ModelConfiguration) {
self.init(entityClass: entity, configuration: configuration, inferStoreIfPossible: false)
}
@@ -125,7 +125,7 @@ public struct Into<T: DynamicObject>: Hashable {
internal let inferStoreIfPossible: Bool
internal init(entityClass: T.Type, configuration: ModelConfiguration, inferStoreIfPossible: Bool) {
internal init(entityClass: D.Type, configuration: ModelConfiguration, inferStoreIfPossible: Bool) {
self.entityClass = entityClass
self.configuration = configuration