Skip to content
New issue

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

윤회성(B) - Spring Project with JPA and H2 Database #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

squareCaaat
Copy link

@squareCaaat squareCaaat commented Jul 11, 2024

H2 DB 연동 결과 (in-memory)
스크린샷 2024-07-11 165422

Create Student 결과 (반환값은 id입니다!)
스크린샷 2024-07-11 170857

Get Student 결과
스크린샷 2024-07-11 170911

Create Course 결과 (반환값은 id입니다)
스크린샷 2024-07-11 170956

Get Course 결과
스크린샷 2024-07-11 171151

Create(enroll) Enrollment 결과
스크린샷 2024-07-11 171238

특정 학생의 과목 조회 결과
스크린샷 2024-07-11 164735

과목의 학생 수 조회 결과
스크린샷 2024-07-11 164811

과목에서 같은 이름을 가진 학생 조회 결과
스크린샷 2024-07-11 164836

특정 과목의 모든 학생 조회 결과
스크린샷 2024-07-11 172020

아직 많이 미숙하지만 피드백 부탁드립니다!!
common DTO를 만들어서 해당 DTO에 data를 담는 DTO를 넣어주고 싶은데 (e.g. responseEntity 같은 형식) 아직 잘 모르겠습니다...

@squareCaaat squareCaaat changed the title H2DB Test Assignment [윤회성(B)] H2DB Test Assignment Jul 11, 2024
@squareCaaat
Copy link
Author

@squareCaaat squareCaaat changed the title [윤회성(B)] H2DB Test Assignment 윤회성(B) - Spring Project with JPA and H2 Database Jul 11, 2024
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OneToMany 지정하니 순환 참조 문제가 생겨서 DTO를 사용해서 Entity를 toDto로 하려고 했는데 익숙지 않아서 잘 모르겠습니다... 그래서 일단 단방향으로 구성했습니다!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ResponseDto를 만들어 해당 Dto를 반환하니 일단 문제는 해결되었습니다!

@squareCaaat
Copy link
Author

squareCaaat commented Jul 12, 2024

  • 1:N, N:1 순환 참조를 막기 위해 Contorller에서 ResponseDto를 반환하니 당장의 문제는 사라졌습니다!
  • DTO들을 통합하였습니다!

https://github.com/squareCaaat/dbtest/tree/testDev
바뀐 부분은 PR 확인해주시면 감사하겠습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant