Jinsu's Technical Blog
  • 홈
  • 태그
  • 방명록
  • 메뉴 닫기
  • 글작성
  • 방명록
  • 환경설정
    • 분류 전체보기 (250)
      • Java (18)
      • Spring Framework (33)
        • Toby's Spring 3.1 (6)
        • Spring IoC (6)
        • TDD (6)
        • Reflection (6)
        • AOP (6)
      • Spring Boot (11)
      • Spring Security (22)
      • Database (17)
        • Mysql (2)
        • JDBC (2)
        • JPA (13)
      • Build and Development Tools (3)
        • Maven (1)
        • Gradle (1)
        • Lombok (1)
      • Network (12)
      • Apache Tomcat (11)
      • Microservices Architecture (33)
      • Linux (9)
      • React (10)
      • Docker (22)
      • OAuth (10)
      • DevOps (2)
      • Git (2)
      • HTML (1)
      • CSS (1)
      • JavaScript (1)
      • Problem and Solution Guide (8)
        • Java (1)
        • Spring Framework (4)
        • Reflection (1)
        • Dynamic Proxy (1)
        • JPA (1)
      • Note-Taking (23)
  • 홈
  • 태그
  • 방명록
Problem and Solution Guide/JPA

JPA 핵심 문제 풀이: 실무에서 자주 마주하는 이슈와 해결법

문제 1: 단방향 연관관계 매핑 - ManyToOne 문제:Order와 Customer 엔티티가 있다. 각 주문은 하나의 고객에게만 속하지만, 한 고객은 여러 개의 주문을 할 수 있다. 이를 단방향 연관관계로 매핑하고, Order 엔티티에 고객과의 연관관계를 설정하는 코드를 작성해보세요. 풀이:단방향 연관관계에서, Order 엔티티가 Customer 엔티티를 참조하도록 설정하면 돼.@Entitypublic class Order { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String orderDate; @ManyToOne @JoinColumn(name = "cus..

2024. 9. 23. 09:12
  • «
  • 1
  • »

공지사항

  • Jinsu's GitHub

전체 카테고리

  • 분류 전체보기 (250)
    • Java (18)
    • Spring Framework (33)
      • Toby's Spring 3.1 (6)
      • Spring IoC (6)
      • TDD (6)
      • Reflection (6)
      • AOP (6)
    • Spring Boot (11)
    • Spring Security (22)
    • Database (17)
      • Mysql (2)
      • JDBC (2)
      • JPA (13)
    • Build and Development Tools (3)
      • Maven (1)
      • Gradle (1)
      • Lombok (1)
    • Network (12)
    • Apache Tomcat (11)
    • Microservices Architecture (33)
    • Linux (9)
    • React (10)
    • Docker (22)
    • OAuth (10)
    • DevOps (2)
    • Git (2)
    • HTML (1)
    • CSS (1)
    • JavaScript (1)
    • Problem and Solution Guide (8)
      • Java (1)
      • Spring Framework (4)
      • Reflection (1)
      • Dynamic Proxy (1)
      • JPA (1)
    • Note-Taking (23)

블로그 인기글

전체 방문자

오늘
어제
전체
Powered by Privatenote Copyright © Jinsu's Technical Blog All rights reserved. TistoryWhaleSkin3.4

티스토리툴바