Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
๐ :: (Meogo-14)refactor #50
๐ :: (Meogo-14)refactor #50
Changes from 4 commits
22e13ca
b1c54c6
82f38d4
ecaa846
8e9aa74
2f87528
4b9493e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
๐ก Codebase verification
id
ํ๋กํผํฐ ์ฌ์ ์๋ก ์ธํ ๋ฌธ์ ๋ฐ๊ฒฌUser.kt
ํ์ผ์์id
ํ๋กํผํฐ๋ฅผoverride val id: UUID? = null
๋ก ์ฌ์ ์ํ๊ณ ์์ต๋๋ค. JPA ์ํฐํฐ์ ID๋ ์ผ๋ฐ์ ์ผ๋กnull
์ผ ์ ์์ผ๋ฏ๋ก, ์ด๋ก ์ธํด ๋ฐ์ดํฐ ๋ฌด๊ฒฐ์ฑ์ ๋ฌธ์ ๊ฐ ๋ฐ์ํ ์ ์์ต๋๋ค.id
ํ๋กํผํฐ๋ฅผ nullableํ์ง ์๋๋ก ๋ณ๊ฒฝํ ๊ฒid
์ ์ด๊ธฐํ๋ฅผ ์ ์ ํ ์ฒ๋ฆฌํ์ฌnull
๊ฐ์ด ํ ๋น๋์ง ์๋๋ก ํ ๊ฒ๐ Analysis chain
id
ํ๋กํผํฐ๋ฅผopen
์ผ๋ก ๋ณ๊ฒฝํ ๊ฒ์ ๋ํ ๊ณ ๋ ค์ฌํญid
ํ๋กํผํฐ๋ฅผopen
์ผ๋ก ๋ณ๊ฒฝํ๋ฉด ํ์ ํด๋์ค์์ ์ด๋ฅผ ์ฌ์ ์ํ ์ ์์ด ์ ์ฐ์ฑ์ด ์ฆ๊ฐํฉ๋๋ค. ํ์ง๋ง ์ด๋ก ์ธํด ๋ช ๊ฐ์ง ์ ์ฌ์ ์ธ ๋ฌธ์ ๊ฐ ๋ฐ์ํ ์ ์์ต๋๋ค:์ด ๋ณ๊ฒฝ์ ์ํฅ์ ํ์ธํ๊ธฐ ์ํด ๋ค์ ์คํฌ๋ฆฝํธ๋ฅผ ์คํํด์ฃผ์ธ์:
์ด ๋ณ๊ฒฝ์ฌํญ์ ๋ํ ๋ฌธ์ํ๋ฅผ ์ถ๊ฐํ๋ ๊ฒ์ด ์ข๊ฒ ์ต๋๋ค. ์๋ฅผ ๋ค์ด:
๐ Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 337
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.
์ด๋ป๊ฒ ๋ณ๊ฒฝํ๋ ๊ฒ์ด ์ข์๊น?
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.
@meltapplee,
BaseUUIDEntity
์id
ํ๋กํผํฐ๋ฅผ nullableํ์ง ์๋๋ก ์์ ํ๊ณ , ํ์ ํด๋์ค์์id
๋ฅผ ์ฌ์ ์ํ์ง ์๋ ๊ฒ์ด ์ข์ต๋๋ค. ์ด๋ ๊ฒ ํ๋ฉด JPA ์ํฐํฐ์ ID๊ฐ ํญ์null
์ด ์๋ ๊ฐ์ผ๋ก ๊ด๋ฆฌ๋์ด ๋ฐ์ดํฐ ๋ฌด๊ฒฐ์ฑ์ ๋ณด์ฅํ ์ ์์ต๋๋ค.์์ ๋
BaseUUIDEntity
๋ ๋ค์๊ณผ ๊ฐ์ด ์์ฑํ ์ ์์ต๋๋ค:๊ทธ๋ฆฌ๊ณ
User
ํด๋์ค์์๋id
ํ๋กํผํฐ๋ฅผ ์ฌ์ ์ํ์ง ์๊ณ ,BaseUUIDEntity
๋ฅผ ๊ทธ๋๋ก ์์๋ฐ๋๋ก ์์ ํฉ๋๋ค. ๋ง์ฝ ํ์ฌUser
ํด๋์ค์์id
๋ฅผ ์ฌ์ ์ํ๊ณ ์๋ค๋ฉด, ํด๋น ๋ถ๋ถ์ ์ ๊ฑฐํด์ฃผ์ธ์:์ด๋ ๊ฒ ํ๋ฉด JPA๊ฐ ์๋์ผ๋ก
id
๋ฅผ ๊ด๋ฆฌํ๋ฉฐ,id
๊ฐnull
์ธ ์ํ๋ก ๋จ์์๋ ๊ฒ์ ๋ฐฉ์งํ ์ ์์ต๋๋ค.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.
User ์ํฐํฐ์์ 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.
@meltapplee,
User
์ํฐํฐ์์๋ ๋ณ๋๋กid
ํ๋กํผํฐ๋ฅผ ์ ์ํ์ง ์๊ณBaseUUIDEntity
๋ฅผ ์์๋ฐ์ ๊ทธ๋๋ก ์ฌ์ฉํ๋ ๊ฒ์ด ์ข์ต๋๋ค. ๋ฐ๋ผ์User
ํด๋์ค๋ ๋ค์๊ณผ ๊ฐ์ด ์์ฑํ ์ ์์ต๋๋ค:BaseUUIDEntity
์์ ์ด๋ฏธid
ํ๋กํผํฐ๋ฅผ ์ ์ํ๊ณ ์์ผ๋ฏ๋ก,User
์ํฐํฐ์์id
๋ฅผ ์ฌ์ ์ํ๊ฑฐ๋ ์ด๊ธฐํํ ํ์๊ฐ ์์ต๋๋ค. ์ด๋ ๊ฒ ํ๋ฉด JPA๊ฐ ์๋์ผ๋กid
๊ฐ์ ์์ฑํ๊ณ ๊ด๋ฆฌํ์ฌ ๋ฐ์ดํฐ ๋ฌด๊ฒฐ์ฑ์ ์ ์งํ ์ ์์ต๋๋ค.