We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@ManyToOne
다음과 같은 구조의 연관 관계를 가진 엔티티가 있다고 할 때, order에는 외래키가 생성되어야 합니다.
/** * 상품 엔티티 */ @Entity() class Product { @PrimaryGeneratedColumn() id!: number; @Column({ length: 255, nullable: false, type: "varchar", }) name!: string; @Column({ type: "int", nullable: false, length: 11, // default: 0, }) price!: number; } @Entity() class Order { @PrimaryGeneratedColumn() id!: number; @Column({ type: "int", nullable: false, length: 11, // name: "product_id", 면 생성이 되질 않음 }) productId!: number; @ManyToOne(() => Product, (product) => product.id, { joinColumn: "productId", }) product!: Product; }
현재 연결할 키를 설정할 때, 옵션에서 joinColumn을 기입하여 찾고 있는데, 해당 옵션이 null 일 때에도 Product 테이블에서 기본키를 찾을 수 있어야 합니다.
The text was updated successfully, but these errors were encountered:
#42, #44, #46, #47 은 결국 하나의 문제로 귀결됩니다. EntityManager.find를 호출하였을 때 제대로 역직렬화를 하는가? 입니다. 현재 내부 API는 완성되어있지만 관련된 메타데이터 체계를 어떻게 할 지 고민중입니다.
EntityManager.find
Sorry, something went wrong.
No branches or pull requests
다음과 같은 구조의 연관 관계를 가진 엔티티가 있다고 할 때, order에는 외래키가 생성되어야 합니다.
현재 연결할 키를 설정할 때, 옵션에서 joinColumn을 기입하여 찾고 있는데, 해당 옵션이 null 일 때에도 Product 테이블에서 기본키를 찾을 수 있어야 합니다.
The text was updated successfully, but these errors were encountered: