Why TypeORM set automatically null if does not find the join on leftJoinAndMapOne?

27 Views Asked by At

I've a big question about TypeORM. Why TypeORM set automatically null if does not find the join on leftJoinAndMapOne? How can I set it to leave the current value if it doesn't find any joins? I've been working on it for more than a month but without finding any solutions, thank you in advance for your help.

I tried to set { nullOnLeft: false } but without success.

const events = AppDataSource.getRepository(EventORM)
 .createQueryBuilder("events")
 .leftJoinAndMapOne("events.installationId", InstallationORM, "installations", "events.installationId = installations.id")
 .leftJoinAndMapOne("events.cardCode", CardORM, "cards", "events.cardCode = cards.cardCode", **{ nullOnLeft: false }**)
 .leftJoinAndMapOne("cards.subjectId", SubjectORM, "subjects", "cards.subjectId = subjects.id")
0

There are 0 best solutions below