-
Notifications
You must be signed in to change notification settings - Fork 301
π 3λ¨κ³ - μκ°μ μ²(DB μ μ©) #756
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
base: gukin-han
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.
κ°λ¨ν νΌλλ°±μ λ¨κ²Όμ΅λλ€~ νμΈ νλ² λΆνλ립λλ€!
|
||
import java.time.LocalDateTime; | ||
|
||
public class EnrolledStudent { |
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.
κ΅³μ΄ Enrolledλ₯Ό λΆμΌ μ΄μ κ° μμκΉμ?
Studentλ‘λ§μΌλ‘λ μΆ©λΆν λλ©μΈ μ€λͺ
μ΄ κ°λ₯ν΄ λ³΄μ¬μμ~
public class EnrolledStudent { | ||
private Long id; | ||
|
||
private String userId; |
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λ₯Ό κ°μ§κ³ μκ² νλ©΄ μ΄λ¨κΉμ?
String sql = "INSERT INTO enrolled_student (session_id, user_id, enrolled_at) VALUES (?, ?, ?)"; | ||
jdbcTemplate.update( | ||
sql, | ||
enrolledStudent.getSession().getId(), // session κ°μ²΄μμ 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.
λλ―Έν°μ λ²μΉμ μλ°νκ² κ°μ΅λλ€.
λ°λ‘ Idλ§ λΉΌλ getterλ₯Ό λ§λμλ©΄ μ΄λ¨κΉμ?
CoverImage coverImage = new CoverImage( | ||
rs.getInt("cover_image_size"), | ||
ImageType.valueOf(rs.getString("cover_image_type")), | ||
rs.getInt("cover_image_width"), | ||
rs.getInt("cover_image_height") | ||
); |
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.
CoverImageκ° μ¬μ¬μ©λ μΌμ΄ μμκΉμ?
μ κ·ν κ΄μ μμ νλ² κ³ λ―Όν΄λ³΄μ
¨μΌλ©΄ μ’κ² μ΅λλ€.
μλ νμΈμ 리뷰μ΄λ!
3λ¨κ³ λ―Έμ μ DBμ λλ©μΈμ λΆλ¦¬ κ°κ°μ λ껴보λκ² μλμΈκ² κ°μ΅λλ€.
λ무 μκ° λΊκΈ°λκ² κ°μμ μλΉμ€ λ μ΄μ΄μμ νμλ‘ νλ DAOμ λ©μλλ§ μ΅μνμΌλ‘ ꡬννμ΄μ. μλλ μ κ° μκ°νλ μ΄ λ―Έμ μμ μ»μ΄κ°μΌν μκ°λ€μ μ 리ν΄λ³΄μμ΅λλ€.