์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
- Reversing
- ์ต๋จ ๊ฒฝ๋ก
- ๋งต
- java
- ์คํ
- dfs
- web
- GCP
- ๋ฐฑํธ๋ํน
- ์ฐ์ ์์ ํ
- ๊ทธ๋ฆฌ๋
- dynamic debugging
- CVE
- c++
- Spring
- ์์ ์ ๋ ฌ
- ๊ตฌํ
- ์ฌ๊ท
- BFS
- OS
- ๋ถํ ์ ๋ณต
- DP
- ๋ฐ์ดํฌ์คํธ๋ผ
- JPA
- ๋์ ํฉ
- thymeleaf
- ๋ฌธ์์ด
- error
- ์ด๋ถ ํ์
- ์๋ฎฌ๋ ์ด์
- Today
- Total
๋ชฉ๋ก๐๐ปโ๏ธ ๊ธฐ๋ณธํ๋ จ (32)
hades

JPA ์๊ฐJPAJava Persistnce APIJava ์ง์์ ORM ํ์ค ORMObject-relational mapping (๊ฐ์ฒด ๊ด๊ณ ๋งคํ)๊ฐ์ฒด๋ ๊ฐ์ฒด๋๋ก ์ค๊ณํ๊ณ , ๊ด๊ณํ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ ๊ด๊ณํ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋๋ก ์ค๊ณํ๊ณ , ORM ํ๋ ์์ํฌ๊ฐ ๊ฐ์ฒด์ ๊ด๊ณํ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ์ค๊ฐ์์ ๋งคํ๋์ค์ ์ธ ์ธ์ด์๋ ๋๋ถ๋ถ ORM ๊ธฐ์ ์ด ์กด์ฌ JPA๋ ์ ํ๋ฆฌ์ผ์ด์ ๊ณผ JDBC ์ฌ์ด์์ ๋์์ฐธ๊ณ ) JDBC(Java Database Connectivity)๋ ์๋ฐ์์ ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ ์ํ ์ ์๋๋ก ํ๋ ์๋ฐ API์ด๋ค. ํธ๋์ญ์ (Transaction)์ ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ํ๋ฅผ ๋ณํ์ํค๊ธฐ ํด์ ์ํํ๋ ์์ ์ ๋จ์์ด๋ค. ํ๋์ ์ฟผ๋ฆฌ๋ฌธ์ด ์๋๋ค. JPA ๋์ - ์ ์ฅpersist๋ฅผ ํ๋ค๋ฉด, MemberDAO(EntityM..
๐จ ์๋ฌ Caused by: org.attoparser.ParseException: Error resolving template [fragments/header], template might not exist or might not be accessible by any of the configured Template Resolvers (template: "home" - line 3, col 7) Caused by: org.thymeleaf.exceptions.TemplateInputException: Error resolving template [fragments/header], template might not exist or might not be accessible by any of the co..
๐จ ์๋ฌCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to determine Dialect without JDBC metadata (please set 'j..

ํ๋ก์ ํธ ํ๊ฒฝ์ค์ H2์ Thymeleaf ๋์ ํ์ธ ํ, application.yml ํ์ผ ์์ฑSpring: datasource: url: jdbc:h2:tcp://localhost/~/jpashop; username : sa password: driver-class-name: org.h2.Driver jpa: hibernate: ddl-auto: create properties: hibernate:# show_sql: true format_sql: truelogging: level: org.hibernate.SQL: debugddl-auto: create๋ ์ ํ๋ฆฌ์ผ์ด์ ์คํ ์์ ์ ํ ์ด๋ธ์ ์๋ก ์์ฑํ๋ค. Membe..

๐จ ์๋ฌjava.lang.AssertionError: Expecting actual: jpabook.jpashop.Member@3fed0c04 and: jpabook.jpashop.Member@7d49fe37 to refer to the same object ๐ ๋ถ์Member๋ผ๋ ๊ฐ์ฒด๋ฅผ ๋ง๋ค๊ณ , ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ ์ฅํ ํ, id๋ก ์ ์ฅ๋ Member๋ฅผ ๋ฐ์์ isSameAs๋ก ๋น๊ตํ๋ ๊ฐ์ง ์๋ค๊ณ ํ๋ค. ๐ ํด๊ฒฐisSameAs๋ ์ฐธ์กฐ๋ฅผ ๋น๊ตํ๋ ๊ฒ์ธ๋ฐ, ์์ฑํ์ ๋์ Member์ ์ฐธ์กฐ๋ ๋ฐ์ดํฐ๋ฒ ์ด์ค์์๊น์ง ์ ์ง๋์ง๋ ์๋๋ค. ๋จ์ง, id์ username์ด ๊ฐ์์ง๋ง ํ์ธํ๋ฉด ๋๋ฏ๋ก, isEqualTo๋ฅผ ์ด์ฉํ๋ค.

๐จ ์๋ฌParameter 0 of constructor in hello.core.member.MemberServiceImpl required a single bean, but 2 were found: - memoryMemberRepository: defined in file [C:\Users\hades\Desktop\study\core\out\production\classes\hello\core\member\MemoryMemberRepository.class] - memberRepository: defined by method 'memberRepository' in class path resource [hello/core/AppConfig.class] ๐ ๋ถ์MemberServiceImpl์ด ํ๋์ ..

์คํ๋ง ์ปจํ ์ด๋์ ์คํ๋ง ๋น์คํ๋ง ์ปจํ ์ด๋ ์์ฑApplicationContext๋ ์คํ๋ง ์ปจํ ์ด๋์ด์ ์ธํฐํ์ด์ค์ด๋ค. ๋ฐ๋ผ์ ๋คํ์ฑ์ด ์ ์ฉ๋๋ค. AnnotationConfigApplicationContext๋ ์๊ณ , ๋ค๋ฅธ ApplicationContext๋ค๋ ์๋ค.์ค์ ์์ ๋ํ๋ด๋ @Configuration์ด ๋ถ์ AppConfig.class๋ฅผ ๋งค๊ฐ๋ณ์๋ก ํ๋ AnnotationConfigApplicationContext์ ์์ฑํ๋ฉด, @Bean์ด ๋ถ์ ๊ฒ๋ค์ด ์คํ๋ง ์ ์ฅ์์ ์ ์ฅ๋๋ค. ๋น ์ด๋ฆ์ ๋ฉ์๋ ์ด๋ฆ, ๋น ๊ฐ์ฒด๋ return ๊ฐ์ด๋ค. ๋น์ ์ด๋ฆ์ ๊ธฐ๋ณธ์ ์ผ๋ก ๋ฉ์๋ ์ด๋ฆ์ด๋ฉฐ, ํญ์ ๋ค๋ฅธ ์ด๋ฆ์ ๋ถ์ฌํด์ผ ํ๋ค. 3. ์คํ๋ง ๋น ์์กด ๊ด๊ณ ์ค์ ์คํ๋ง ์ปจํ ์ด๋๋ ์ค์ ์ ๋ณด๋ฅผ ์ฐธ๊ณ ํด์ ์์กด๊ด๊ณ๋ฅผ ์ฃผ์ ํ๋ค...

ํ๋ก์ ํธ ์์ฑSpring ํ๋ก์ ํธ๋ https://start.spring.io/ ์์ ์์ฑํ๋ค.๊ธฐ๋ณธ์ ์ผ๋ก ์์ ๊ฐ์ด ์ค์ ํ Generateํ๋ฉด ํ๋ก์ ํธ๊ฐ ์์ฑ๋๋ค. ๊ตฌ์ฑ ํญ๋ชฉ๋ค์ ์ดํด๋ณด์. src์์ main๊ณผ test๋ฅผ ๋ถ๋ฆฌํด๋์๋๋ฐ, ์ด๋ test๊ฐ ์์ฆ ๊ฐ๋ฐ์์ ์ค์ํ๋ค๋ ๊ฒ์ ์๋ฏธํ๋ค.main์์ java๋ฅผ ์ ์ธํ ๋ชจ๋ ํ์ผ์ resources์ ์๋ค. gradle์ ๋ฒ์ ์ค์ ๋ฐ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ๊ฐ์ ธ์ค๋ ์ญํ ์ ํ๋ค. HelloSpringApplication์ Application์ ์คํ์ํค๋๋ฐ ์์ฒด์ ์ผ๋ก ์๋ฒ ๊ธฐ๋ฅ์ ํ ์ ์๊ฒ ํด์ฃผ๋ ํฐ์บฃ์ ๋ด์ฅํ๊ณ ์์ด์, ์๋ฒ ์ญํ ์ ๊ฐ๋ฅํ๊ฒ ํ๋ค. Setting - Build - Gradle์์ IntelliJ IDEA๋ก ๋ฐ๊พธ๋ฉด, ์์ฒด์ ์ผ๋ก ์คํํ์ฌ ๋นจ๋ผ..

๋์ปค๊ฐ ์ปจํ ์ด๋๋ฅผ ์ด์ฉํ๋ค. ์ปจํ ์ด๋๋ ๊ฐ์๋จธ์ ์ฒ๋ผ ํ๋์จ์ด๋ฅผ ์ ๋ถ ๊ตฌํํ์ง ์๊ธฐ ๋๋ฌธ์ ๋งค์ฐ ๋น ๋ฅด๊ฒ ์คํ์ด ๊ฐ๋ฅํ๋ค. ํ์ง๋ง, ๊ฐ์๋จธ์ ์ฒ๋ผ ๊ฐ ๋ง์ดํฌ๋ก์๋น์ค๋ฅผ ๊ฒฉ๋ฆฌํ๋ ๊ธฐ๋ฅ์ ์ ๊ณตํ๋ค. ๋ฆฌ๋ ์ค ์ปจํธ๋กค ๊ทธ๋ฃน์ด๋ ํ๋ก์ธ์ค๋ก ์๋นํ ์ ์๋ ๋ฆฌ์์ค(CPU, ๋ฉ๋ชจ๋ฆฌ, ๋คํธ์ํฌ ๋์ญ๋ ๋ฑ)์ ์ ํํ๋ค. ๋์ปค ๋ ์ง์คํธ๋ฆฌ์๋ ์ฌ์ฉ์๊ฐ ์ฌ์ฉํ ์ ์๋๋ก ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ํตํด Image๋ฅผ ์ ๊ณตํด์ฃผ๊ณ ์๋ค. github์ ์ฝ๋๋ฅผ ์ ์ฅํ๋ ๊ฒ๊ณผ ๋น์ทํ๋ค. Public Cloud๋ public registry, On-premises๋ private registry๋ฅผ ์๋ฏธํ๋ค.Registry์์ Image๋ฅผ PULLํ๊ณ , ๊ทธ Image๋ก Container๋ฅผ ๋ง๋ค์ด Memory์์ ์คํ์ํจ๋ค.Container๋ ๊ฐ์ ์ค์ ์ผ๋ก ์ค..