전체 글

좋은 영향력을 전파하기 위해 노력하는 엔지니어 리오입니다.
문제 설명 네트워크란 컴퓨터 상호 간에 정보를 교환할 수 있도록 연결된 형태를 의미합니다. 예를 들어, 컴퓨터 A와 컴퓨터 B가 직접적으로 연결되어있고, 컴퓨터 B와 컴퓨터 C가 직접적으로 연결되어 있을 때 컴퓨터 A와 컴퓨터 C도 간접적으로 연결되어 정보를 교환할 수 있습니다. 따라서 컴퓨터 A, B, C는 모두 같은 네트워크 상에 있다고 할 수 있습니다. 컴퓨터의 개수 n, 연결에 대한 정보가 담긴 2차원 배열 computers가 매개변수로 주어질 때, 네트워크의 개수를 return 하도록 solution 함수를 작성하시오. 제한사항 컴퓨터의 개수 n은 1 이상 200 이하인 자연수입니다. 각 컴퓨터는 0부터 n-1인 정수로 표현합니다. i번 컴퓨터와 j번 컴퓨터가 연결되어 있으면 computers[..
기존 Controller @RequiredArgsConstructor @Controller public class IndexController { private final GamesService gamesService; private final HttpSession httpSession; @GetMapping("/") public String index(Model model){ model.addAttribute("games", gamesService.findAllPaging(0,9)); SessionUser user = (SessionUser) httpSession.getAttribute("user") if (user != null) { model.addAttribute("userName",user.ge..
1. Security 설정 스프링 시큐리티를 사용하는데 쓸 기능들을 명시해준다 @RequiredArgsConstructor // 스프링 시큐리티 설정 활성화 @EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { private final CustomOAuth2UserService customOAuth2UserService; protected void configure(HttpSecurity http) throws Exception { http .csrf().disable() .headers().frameOptions().disable().disable() .authorizeRequests() //URL 별 ..
TestCode @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment= SpringBootTest.WebEnvironment.RANDOM_PORT) @Transactional public class GamesApiControllerTest extends TestCase { @Autowired private TestRestTemplate restTemplate; @LocalServerPort private int port; @Test public void testGamesReResponse() { Integer request = 1; String url = "http://localhost:"+port+"/api/appendGames"; //when Re..
· JAVA/JPA
조인 - 객체 끼리 조인을 통해 조인 쿼리문을 사용할 수 있다. • 내부 조인 SELECT m FROM Member m [INNER] JOIN m.team t • 외부 조인 SELECT m FROM Member m LEFT [OUTER] JOIN m.team t • 세타 조인 select count(m) from Member m, Team t where m.username = t.name 조인 - ON 절 1. 조인 대상 필터링 • 예) 회원과 팀을 조인하면서, 팀 이름이 A인 팀만 조인 JPQL SELECT m, t FROM Member m LEFT JOIN m.team t on t.name = 'A' SQL SELECT m.*, t.* FROM Member m LEFT JOIN Team t ON m...
· JAVA/JPA
페이징 - 데이터 베이스를 조회할 때 n번 부터 m번까지 조회 할 수 있도록 해주는 api 페이징 API • JPA는 페이징을 다음 두 API로 추상화 • setFirstResult(int startPosition) : 조회 시작 위치 (0부터 시작) • setMaxResults(int maxResult) : 조회할 데이터 수 example //페이징 쿼리 String jpql = "select m from Member m order by m.name desc"; List resultList = em.createQuery(jpql, Member.class) .setFirstResult(10) .setMaxResults(20) .getResultList();
ri5
리오의 개발일지