     static func reflectTargetType(on decoder: CodableModelDecoder) throws
                   -> CodableEntityType
     {
-      if !decoder.hasEntityForType(T.self) {
-        _ = try decoder.decode(T.self) // reflect on target entity
+      if !decoder.hasEntityForType(TargetType.self) {
+        _ = try decoder.decode(TargetType.self) // reflect on target entity
       }
       
       // TODO: we can pass in this type?!

        fatalError("no entity?")
      }
      
      let entity = decoder.lookupOrCreateTypedEntity(T.self)
      return entity
    }
    

   * A container to maintain a ToMany relationship to a set of different
   * objects.
   *
   * This is usually used with the `ToMany` typealias, for example like this:
   *
   *     var addresses : ToMany<Address>
   *
   * NOTE: This is *NOT* a `Relationship` object. It is more like a `Fault`
   *       and necessary because `Codable` doesn't deal well with recursive
   *       relationships.
   */
  public struct ToManyRelationshipHolder<TargetType: CodableObjectType>
                  : Codable
  {
    // TODO: like a toMany fault?
    // TBD: should this have a reference to the `Relationship` itself?

