         throw CodableModelDecoder.Error.missingEntity
       }
       
-      let entity = decoder.lookupOrCreateTypedEntity(T.self)
+      let entity = decoder.lookupOrCreateTypedEntity(TargetType.self)
       return entity
     }
     

                  -> Relationship
    {
      // TBD: isOptional doesn't really matter here, right?
      let rs = CodableRelationship<T>(name: name, isToMany: true,
                                      isMandatory: !isOptional, // TBD
                                      source: source, destination: destination)
      return rs

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