     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?!

                  -> 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

      // Create a typed relationship, this works because the
      // `ToOneRelationshipHolder` has the static type of the target as the
      // generic argument.
      let rs = CodableRelationship<TargetType>(name: name, isToMany: false,
                                      isMandatory: !isOptional,
                                      source: source, destination: destination)
      return rs
