Bird
0
0

In NestJS with TypeORM, which decorator is used to specify the inverse side of a ManyToOne relationship?

easy📝 Conceptual Q2 of 15
NestJS - Database with TypeORM
In NestJS with TypeORM, which decorator is used to specify the inverse side of a ManyToOne relationship?
A@PrimaryGeneratedColumn
B@JoinColumn
C@ManyToMany
D@OneToMany
Step-by-Step Solution
Solution:
  1. Step 1: Understand relation sides

    The owning side of a ManyToOne relation uses @ManyToOne, while the inverse side uses @OneToMany.
  2. Step 2: Identify inverse decorator

    Since the question asks for the inverse side, the correct decorator is @OneToMany.
  3. Final Answer:

    @OneToMany -> Option D
  4. Quick Check:

    Inverse side uses @OneToMany [OK]
Quick Trick: Inverse side of ManyToOne is OneToMany [OK]
Common Mistakes:
  • Confusing owning and inverse sides
  • Using @ManyToMany instead of @OneToMany
  • Assuming @JoinColumn defines the inverse side

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NestJS Quizzes