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

2단계 - Proxy #125

Open
wants to merge 5 commits into
base: yangseungin
Choose a base branch
from
Open

Conversation

yangseungin
Copy link

안녕하세요 종민님.
그전단계에서 해결못한 부분만 우선 수정해서 PR올렸습니다.
#105 (comment)
이부분은 아직 반영하지 못하였습니다

Copy link
Member

@jongmin4943 jongmin4943 left a comment

Choose a reason for hiding this comment

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

안녕하세요 승인님!

미션 2단계 리뷰요청 주셨는데 요구사항이 진행이 안되어있네요 😢

미션을 진행 한 뒤 리뷰요청 주시면 감사하겠습니다 🙇

Comment on lines +89 to +92
assertThat(selectResult.get(0).getProduct()).isEqualTo("감자");
assertThat(selectResult.get(0).getQuantity()).isEqualTo(3);
assertThat(selectResult.get(1).getProduct()).isEqualTo("고구마");
assertThat(selectResult.get(1).getQuantity()).isEqualTo(1);
Copy link
Member

Choose a reason for hiding this comment

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

전 단계 피드백 반영해주셨네요 👍

Comment on lines +42 to 46
private List<Field> findOneToManyFields(Class<?> clazz) {
return Arrays.stream(clazz.getDeclaredFields())
.filter(field -> field.isAnnotationPresent(OneToMany.class))
.findFirst()
.orElseThrow(() -> new RuntimeException("OneToMany 필드를 찾을 수 없습니다."));
.collect(Collectors.toList());
}
Copy link
Member

Choose a reason for hiding this comment

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

여전히 이 행위는 QueryBuilder 가 하기에는 과한 책임 같아요 😢

ParentEntity 의 metadata 로 가져와 볼 수 있지 않을까요?

columns.add(oneToManyColumn.getForeignKeyColumnName());
List<Field> oneToManyFields = findOneToManyFields(parentEntity.getClass());
for (Field oneToManyField : oneToManyFields) {
EntityColumn oneToManyColumn = EntityColumn.from(oneToManyField);
Copy link
Member

Choose a reason for hiding this comment

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

그럼 매번 여기서 생성 할 필요 없을 것 같아요

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.

2 participants