honp
@loverman856634
Reviews Written
5
Average Rating
5.0
Posts
Q&A
vue cli ๋ฒ์ ์ด 4์ด์์ธ ๊ฒฝ์ฐ์๋ ์ด๋ป๊ฒ ํด์ผ๋ ์ง ๋ชจ๋ฅด๊ฒ ์ด์.
Most of Vue Router API has remained unchanged during its rewrite from v3 (for Vue 2) to v4 (for Vue 3) vue3 ๋ vue router 4 ๋ฒ์ ์ ์ฌ์ฉํด์ผํ๊ณ , vue2๋ vue router 3๋ฒ์ ์ ์ฌ์ฉํด์ผ ํ๋๊ฒ ๊ฐ์ต๋๋ค. ์ฐธ๊ณ ํ์ธ์!
- 2
- 6
- 943
Q&A
transition enter
vue3๊ฐ ๊ธฐ๋ณธ๋ฒ์ ์ผ๋ก ๋ฐ๋๋ฉด์ vue transition์ ๊ตฌ๊ธ๋ก ๊ฒ์ํ๋ฉด ๋งจ ์ฒซ ๋ฒ์งธ ๊ฒ์๊ฒฐ๊ณผ๋ 3๋ฒ์ ๋ฌธ์๊ฐ ๋์ค๋ค์ 2๋ฒ์ ์ ์๋ url์ ์ฐธ๊ณ ํ๋ฉด ์ข์๊ฒ ๊ฐ์ต๋๋ค! https://v2.vuejs.org/v2/guide/transitions.html https://v2.vuejs.org/v2/guide/transitions.html#List-Entering-Leaving-Transitions
- 7
- 2
- 384
Q&A
scf ์๋์ด ์๋ฉ๋๋ค.
์๊ธฐ ์ฐธ๊ณ ํด๋ ์ข๊ฒ๋ค์! https://vuejs.github.io/vetur/guide/snippet.html
- 1
- 4
- 504
Q&A
findAll() ๋ฉ์๋
์ ๋ต๋ณ๊ฐ์ฌํฉ๋๋ค. jpql์ ์ฌ์ฉํ๋ค๋ ์ ๊ธฐํ๋ค์. ๊ถ๊ธํ๊ฒ ์๋๋ฐ์ ๊ธฐ์ ๋์ ์ ๋ฐ๋ด์ฉ์ ์ด๋ป๊ฒ ์์๋๊ฑฐ์์? jpa๋ํ๋จผํธ๋ฅผ ๋ณด๋ฉด ๋์ค๋์?? ํน์ url์ด์๋ค๋ฉด ์ข ์๋ ค์ฃผ์ค์ ์์๊น์ ใ ์ ๋ ๋์ค์ ๊ถ๊ธํ๊ฑฐ๋ ์ดํด์๋๋ ๋ถ๋ถ์ด ์์ผ๋ฉด ์ค์ค๋ก ๋ต์ ์ฐพ๊ณ ์ถ์ด์ ์ฌ์ญค๋ด ๋๋ค :) ๊ทธ๋ฆฌ๊ณ ์ ํฌ๋ธ๋ฅผ ํตํด ์๋ก์ด ๊ฐ์๊ฐ ๋์จ๋ค๊ณ ๋ค์์ต๋๋ค. ๊ธฐ๋๋๋ค์~ใ ใ
- 0
- 5
- 494
Q&A
findAll() ๋ฉ์๋
๋ค ๋ต๋ณ ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. ๋จผ์ ๊ธฐ๋ถ๋์์ จ๋ค๋ฉด ์ฌ๊ณผ๋๋ฆด๊ฒ์ใ ใ ๊ทธ๋ฆฌ๊ณ ์ด ์ง๋ฌธ์ด ์คํ๋ง ๋ฐ์ดํฐ JPA 2. JpaRepository.save() ๋ฉ์๋ ์ด ๊ฐ์์ ๋์ด์๋์ง ์ ๋ชจ๋ฅด๊ฒ ๋ค์ ๋ค๋ฅธ๋ฐ์ ์ง๋ฌธ์ ๋จ๊ธด๊ฒ ๊ฐ์๋ฐใ ใ ์๋ง ์คํ๋ง ๋ฐ์ดํฐ JPA 7.EntityGraph ๊ฐ์์ ์ง๋ฌธ์ ๋จ๊ฒผ๋๊ฒ ๊ฐ์ต๋๋ค... ์ด ๊ฐ์์ ์ง๋ฌธ์ ๋ณด๋ฉด 3๊ฐ์ค์ 2๊ฐ๊ฐ ๋ต๋ณ์ด ์์ด์ ๋ต๋ณ์ด ์ ์ ๋ฌ๋ฆฌ๋๋ณด๋ค ์๊ฐํ์ต๋๋คใ ใ ์ข์๊ฐ์ ์๋ฃ๊ณ ์์ด์ ๊ฐ์ฌํ๋ฐ ๊ธฐ๋ถ๋์๊ฒ ํด์ ์ฃ์กํด์ฌใ ใ ์ ๊ฐ 3๊ฐ์ง๋ฅผ ํด๋ดค๋๋ฐ์ ManyToOne์ผ๋ก fetch ์ ๋ต์ 1)default๋ก ํ๊ฒฝ์ฐ 2)LAZY๋ก ํ๊ฒฝ์ฐ 3)EAGER๋ก ํ๊ฒฝ์ฐ๋ก ํด๋ดค์ต๋๋ค. 1)fetch์ ๋ต์ default๋ก ํ๊ฒฝ์ฐ - findAll() : lazy๋ก ๋์, findById() : EAGER๋ก ๋์ 2)fetch์ ๋ต์ lazy๋ก ํ๊ฒฝ์ฐ - findAll() : lazy๋ก ๋์, findById() : lazy๋ก ๋์ 3)fetch์ ๋ต์ eager๋ก ํ๊ฒฝ์ฐ - findAll() : lazy๋ก ๋์, findById() : eager๋ก ๋์ ์๋ ์ฝ๋๋ ๊ฒฐ๊ณผ๋ ์์ฑํด ๋๋ฆฝ๋๋ค.. ํน์ ์ ๊ฐ ์๋ชป ์ค์ ํด์ ๊ทธ๋ฐ๊ฒ์ด ์๋ค๋ฉด ์ง์ ํด์ฃผ์๊ณ ์๋ ค์ฃผ์๋ฉด ๊ฐ์ฌ๋๋ฆฌ๊ฒ ์ต๋๋ค. ================์ฝ๋=================== package com.hong.springjpa4;import lombok.Getter;import lombok.Setter;import javax.persistence.Entity;import javax.persistence.GeneratedValue;import javax.persistence.Id;@Getter@Setter@Entitypublic class Post { @Id @GeneratedValue private Long id; private String title;} package com.hong.springjpa4;import lombok.Getter;import lombok.Setter;import javax.persistence.*;@Entity@Getter@Setterpublic class Comment { @Id @GeneratedValue private Long id; private String comment;// @ManyToOne(fetch = FetchType.EAGER) @ManyToOne private Post post; private int up; private int down; private boolean best;} package com.hong.springjpa4;import org.springframework.data.jpa.repository.JpaRepository;public interface CommentRepository extends JpaRepository, Long> {} package com.hong.springjpa4;import org.junit.Test;import org.junit.runner.RunWith;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;import org.springframework.test.context.junit4.SpringRunner;import static org.junit.Assert.*;@RunWith(SpringRunner.class)@DataJpaTestpublic class CommentRepositoryTest { @Autowired CommentRepository commentRepository; @Test public void findTest(){ System.out.println("findAll() ================"); commentRepository.findAll(); System.out.println("findById() ================"); commentRepository.findById(1l); }} ================๊ฒฐ๊ณผ=================== 1)fetch๋ฅผ defualt ๋ก ํ๊ฒฝ์ฐ ๊ฒฐ๊ณผ findAll() ================Hibernate: select comment0_.id as id1_0_, comment0_.best as best2_0_, comment0_.comment as comment3_0_, comment0_.down as down4_0_, comment0_.post_id as post_id6_0_, comment0_.up as up5_0_ from comment comment0_findById() ================Hibernate: select comment0_.id as id1_0_0_, comment0_.best as best2_0_0_, comment0_.comment as comment3_0_0_, comment0_.down as down4_0_0_, comment0_.post_id as post_id6_0_0_, comment0_.up as up5_0_0_, post1_.id as id1_1_1_, post1_.title as title2_1_1_ from comment comment0_ left outer join post post1_ on comment0_.post_id=post1_.id where comment0_.id=? 2)fetch์ ๋ต์ lazy๋ก ํ๊ฒฝ์ฐ ๊ฒฐ๊ณผ findAll() ================Hibernate: select comment0_.id as id1_0_, comment0_.best as best2_0_, comment0_.comment as comment3_0_, comment0_.down as down4_0_, comment0_.post_id as post_id6_0_, comment0_.up as up5_0_ from comment comment0_findById() ================Hibernate: select comment0_.id as id1_0_0_, comment0_.best as best2_0_0_, comment0_.comment as comment3_0_0_, comment0_.down as down4_0_0_, comment0_.post_id as post_id6_0_0_, comment0_.up as up5_0_0_ from comment comment0_ where comment0_.id=? 3)fetch ์ ๋ต์ eager๋ก ํ๊ฒฝ์ฐ ๊ฒฐ๊ณผ findAll() ================Hibernate: select comment0_.id as id1_0_, comment0_.best as best2_0_, comment0_.comment as comment3_0_, comment0_.down as down4_0_, comment0_.post_id as post_id6_0_, comment0_.up as up5_0_ from comment comment0_findById() ================Hibernate: select comment0_.id as id1_0_0_, comment0_.best as best2_0_0_, comment0_.comment as comment3_0_0_, comment0_.down as down4_0_0_, comment0_.post_id as post_id6_0_0_, comment0_.up as up5_0_0_, post1_.id as id1_1_1_, post1_.title as title2_1_1_ from comment comment0_ left outer join post post1_ on comment0_.post_id=post1_.id where comment0_.id=?
- 0
- 5
- 494
Q&A
TestRestTemplate ์ผ๋ก getForOjbect ํ์๊ฒฝ์ฐ
๊ฐ์ฌํฉ๋๋ค!!
- 0
- 2
- 361
Q&A
get() static ๋ฉ์๋ importํ ๋
๋ต๋ณํด์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. ๊ทธ๋ฐ๋ฐ ์ ๊ฐ ์ฒจ๋ถํ ์ด๋ฏธ์ง๋ฅผ ๋ณด์๋ฉด get("/hello") ๋ก ๋ฌธ์์ด๊น์ง ์ฝ๋ฉํ ๋ค์์ import ํ๋ ค๊ณ ํ๋๋ฐ ์ ๋ ๊ฒ ๋ํ๋๊ตฌ์.. ์ ๋ง์ ๋ชฉ๋ก์ค์ MockMvcRequestBuilders.get ์ ์ฐพ์๋ ์๋๋ผ๊ตฌ์..ใ ใ ํ ์ ๋ง ์์ด๋ด๊น์ใ ใ
- 0
- 8
- 2.6K




