-
Notifications
You must be signed in to change notification settings - Fork 45
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
1단계 - OneToMany (FetchType.EAGER) #128
base: tmddnrdl333
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
안녕하세요 승욱님 😃
1단계 진행 해주셨네요.
요구사항 진행이 안된 것으로 보이는데, README 와 같은 부분에 어떤 생각을 가지시고, 어떤 것들을 진행했는지 나타내주시면 리뷰하기 좀 더 좋을 것 같아요 👍
만들어 주신 부분을 실행시켜보려 하니, 컴파일 에러가 나는데 확인 부탁드립니다 🙇
미션 진행하시며 궁금한 사항이 있으시면 편하게 코멘트 또는 DM 주세요! 😃
import example.entity.Order; | ||
import example.entity.OrderItem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 두가지 클래스를 찾지 못해 컴파일 에러가 나네요 😭
public class EntityUtils { | ||
public static ColumnInfo getIdColumn(Class<?> clazz) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EntityUtils
정적 메서드들을 가진 클래스인데 정적클래스가 아닌, 특정 객체에게 책임을 주는것은 어떻게 생각하시나요?
public class ColumnInfo { | ||
private TableInfo tableInfo; | ||
private Class<?> columnType; | ||
private String columnName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ColumnInfo
가 TableInfo
를 가지고 있네요. 구현 외적으로 단순히 이름만 보자면, 개인적으로 TableInfo
가 ColumnInfo
들을 가지고 있는게 더 자연스럽다 생각하는데 어떻게 생각하시나요?
public Class<?> getColumnType() { | ||
return columnType; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
현재 쓰이고 있지 않네요. 당장 필요가 없다면 과감히 제거하고, 필요할때 만들어보시는건 어떨까요?
private ColumnInfo onConditionColumn1; | ||
private ColumnInfo onConditionColumn2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
단순히 1, 2 라는 변수 이름을 보고 바로 명확하게 알기 어려울 것 같아요 😢
public String toString() { | ||
StringBuilder stringBuilder = new StringBuilder(); | ||
stringBuilder | ||
.append("select * from ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
select * 이 아닌, 필요한 필드명들을 나열해서 쿼리가 나오도록 만들어주시면 감사하겠습니다 🙇
logger.debug("query : {}", selectQuery); | ||
String query = selectQuery.toString(); | ||
logger.debug(query); | ||
assertThat(query).isEqualTo("select * from orders where id = 1 inner join order_items on orders.order_id = order_items.id;"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
혹시 해당 쿼리가 db 에서 실행이 가능한 정상적인 쿼리가 맞을까요?
구조를 많이 바꾸다보니 작업량이 많아질 것 같아서 일단 PR 올려봅니다..!
계속 진행해나가겠습니다.