일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- springbootH2
- 데이터베이트h2
- springboot기본설정
- 스프링부트
- OSIV
- springbootproxy
- JPA프록시
- 에이치투데이터베이스
- JDBC connection pool
- dockercmd
- Git
- embededtype
- spring
- Open EntityManager
- sql
- javageneric
- MySqlType
- 스프링부트기본설정
- 이해와 원리
- httppie
- jpa
- jpqlquery
- JPAmapping
- 제이피큐엘쿼리
- JPA Hint & Lock
- 자바제너릭
- JPAproxy
- JPA값타입
- 임베디드타입
- gitinitial
- Today
- Total
목록Java/Spring-boot (8)
빡코
테스트 코드를 이용한 테스트 TestRestTemplate package tobyspring.helloboot; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.http.*; import static org.assertj.core.api.Assertions.*; public class HelloApiTest { @Test void helloApi() { //http localhost:8080/hello?name=Spring TestRestTemplate r..
@Configuration : 클래스에 붙이는 어노테이션으로, @Bean을 사용할 때 함께 사용해 주어야 한다. @Bean : 메소드에 붙이는 어노테이션으로, 메소드에서 반환되는 객체를 스프링 빈에 등록한다 @Repository 어노테이션 대신 @Configuration과 @Bean 어노테이션을 활용하여 빈등록하기 package com.group.libraryapp.config; import com.group.libraryapp.repository.user.UserRepository; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org...
@Primary 어노테이션을 사용하여 주입 받는 Repository의 우선순위를 결정할 수 있다. 스프링 컨테이너 없이 직접 의존성을 주입도 가능하다. 하지만 사용하는 Repository가 A에서 B클래스로 변경될 경우 직접 전체 코드를 변경해 주어야하는 번거로움이 발생한다. 이런 경우, 스프링 컨테이너를 사용하여 스프링이 직접 의존성을 관리할 수 있게 위임하여 문제를 해결 수 있다. 이것을 제어의 역전이라고 한다. @RestController public class BookController { private final BookService bookService; public BookController(BookService bookService) { this.bookService = bookServic..
Spring Project에서 MySql 데이터베이스를 추가해주고, Main > Java 패키기와 동일한 위치에 application.yml 파일을 생성해준다. Application.yml 파일 생성 및 정보 spring: datasource: url: "jdbc:mysql://localhost/library" username: "root" password: "1234" driver-class-name: com.mysql.cj.jdbc.Driver #Java Database Connecter를 사용해서 mysql에 접근하고, #접근하려는 mysql은 localhost에 있고, #접근하려는 데이터베이스는 library이다. 예제 User Table 생성 create table user( id bigint ..
보호되어 있는 글입니다.
콘솔에서 쿼리 로그를 확인 할 수 있다. Hibernate: drop table posts if exists Hibernate: create table posts (id bigint generated by default as identity, author varchar(255), Hibernate: insert into posts (id, author, content, title) values (null, ?, ?, ?)content TEXT not null, title varchar(500) not null, primary key (id)) Hibernate: select posts0_.id as id1_0_, posts0_.author as author2_0_, posts0_.content as co..