์น๊ณต๋ทฐ49 [jpa] ์ธ๋ํค๋ก ์กฐํ, entity ๊ฐ์ฒด๋ก ์กฐํ 1. DatasetDetail ํ ์ด๋ธ dataset_id๋ฅผ ์ธ๋ํค๋ก ๊ฐ์ง๊ณ ์๋ ์์ฒญ ํ ์ด๋ธ์ 2. ์ฟผ๋ฆฌ๋ฌธ์ผ๋ก ์ ์คํ๋๋์ง ์ฒดํฌ SELECT * FROM datasetDetail WHERE dataset_id = 59 3. repository ํด๋์ค์์ ์ฟผ๋ฆฌ ์คํํ๋ ค๊ณ ํ์ผ๋ ์คํจํจ. public List findByDatasetId(Long id) { //System.out.println("dataset id : " + dataset.getId()); return em.createQuery("select d from DatasetDetail d where d.dataset = :dataset", DatasetDetail.class) .setParameter("dataset", id) .getResul.. 2021. 7. 16. DI(Dependency Injection) - ๊ฐ์ฒด ์์ฑ์ ์ด๋์ ์ด๋ป๊ฒ ํ๋๋ ์คํ๋ง ํ๋ ์์ํฌ์์๋ Container(IoC)๋ฅผ ๋ง๋ค์ด ๋๊ณ , ๊ทธ ์์์ ๊ฐ์ฒด(bean)๋ฅผ ์์ฑํ์ฌ ํ์ฉํ๋ค. ํ์ํ ๋๋ง๋ค ๊ฐ์ฒด๋ฅผ ์์ฑํ๋ ๊ฒ์ด ์๋๋ผ ๋ฆฌ์์ค์์ ๊ฐ์ฒด๋ฅผ ๊บผ๋ด ์ฌ์ฉํ๋ค๊ณ ์๊ฐํ๋ฉด ๋๋ค. Bean์ ์์ฑํ๋ ๋ฐฉ๋ฒ 1. xml ํ์ผ ์ด์ฉ public class MainClass { public static void main(String[] args) { //1. ๊ธฐ์กด ์๋ฐ ๋ฐฉ๋ฒ TransportationWalk tw = new TransportationWalk(); tw.move(); //2. xml ์ฌ์ฉ ๋ฐฉ๋ฒ GenericXmlApplicationContext ctx = new GenericXmlApplicationContext("classpath:appConfig.xml"); Tra.. 2021. 7. 6. ์คํ๋ง ํ๋ก์ ํธ ์์ฑ ์, ํ์ํ ๊ฐ๋ 1. group id : ํ์ฌ ํ๋ก์ ํธ์ ํ๋ก์ ํธ. 2. artifact id : ํ์ฌ ํ๋ก์ ํธ ์) ํ์ฌ ํ๋ก์ ํธ๊ฐ ๊ฐ๋ น ํํฌ๋ฅผ ๋ง๋ค์ด ์๋น์ค๋ฅผ ํ๋ค๊ณ ์๊ฐํ๋ฉด group id๋ ์ด๋ฒค์ ์ค๊ฐ ๋ ๊ฒ์ด๊ณ artifact id๋ ํํฌ๊ฐ ๋ ๊ฒ. ๋๊ท๋ชจ๋ก ํ๋ก์ ํธ ์งํ์, mother ํ๋ก์ ํธ๋ช ์ group id์ ์ ์ด์ฃผ๋ฉด ๋จ 3. pom.xml - ํ๋ก์ ํธ์ ํ์ํ ๋ชจ๋๋ค์ ์ํฌํธ ํด์ฃผ๋ ์ - ํ์ ๋ชจ๋์ ๊ฐ์ง๊ณ ์ค๊ธฐ ์ํ ํ์ผ 2021. 7. 5. ์๊ณ ๋ณด๋ .... ์์์ฑ ๋ฌธ์ . failed to lazily initialize a collection of role could not initialize proxy JPA๋ก ํ๋ก์ ํธ๋ฅผ ํด์ผ๊ฒ ๋ค๊ณ ๋ง์๋จน๊ณ ๊ฐ๋ฐ์์ํ์ง 2์๊ฐ. ์ ์ ๋ง ์ด ์๋ฌ ๋๋ฌธ์ ์ค๋ ์ฝ์ง์ ๋๋ฌด๋๋ ๋ง์ด ํ๋ค. 6์ 08, 2021 2:10:37 ์คํ org.apache.catalina.core.StandardWrapperValve invoke ์ฌ๊ฐ: ๊ฒฝ๋ก๊ฐ []์ธ ์ปจํ ์คํธ์ ์๋ธ๋ฆฟ [dispatcher]์(๋ฅผ) ์ํ Servlet.service() ํธ์ถ์ด ์์ธ๋ฅผ ๋ฐ์์์ผฐ์ต๋๋ค. com.fasterxml.jackson.databind.JsonMappingException: failed to lazily initialize a collection of role: com.rttq.user.domain.User.privs, could not initialize proxy - no Session (t.. 2021. 6. 8. ์ด์ 1 ยทยทยท 8 9 10 11 12 13 ๋ค์