일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 프로그래머스
- DISTINCT
- 토비의스프링
- db
- Linux
- github
- 해시
- spring boot
- ssh
- Java
- AWS
- Git
- jdbc
- docker
- Hibernate
- mariadb
- spring
- Jenkins
- vagrant
- sample
- EC2
- Client
- 책 정리
- TypeScript
- TLS
- SSL
- window
- centos7
- 코딩테스트
- Spring Legacy Project
- Today
- Total
목록2022/02 (5)
Woopii Vyeolog
● 참고 문서 https://mybatis.org/spring/ko/index.html mybatis-spring – 소개 MyBatis-Spring 은 무엇일까? 마이바티스 스프링 연동모듈은 마이바티스와 스프링을 편하고 간단하게 연동한다. 이 모듈은 마이바티스로 하여금 스프링 트랜잭션에 쉽게 연동되도록 처리한다. mybatis.org ● Mybatis 관련 라이브러리 의존성 추가 pom.xml 에 dependency 추가 org.mybatis mybatis 3.5.7 org.mybatis mybatis-spring 2.0.7 ● Controller, Service, Mapper, Vo 파일 생성 ## 디렉토리 구조 1. vo 생성 package com.project.clone_louisquatorze...
● maven dependency 추가 1. pom.xml에 다음과 같이 추가 org.springframework.boot spring-boot-starter-jdbc ● Entity, repository, service, controller 추가 1. Entity 추가 package com.project.clone_louisquatorze.sample.jpa.entity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import jav..
● schema.sql, data.sql 파일로 DB 초기화 1. 샘플용 schema.sql, data.sql 생성 ## 파일 위치 ## schema.sql DROP TABLE tb_sample IF EXISTS; CREATE TABLE tb_sample ( id bigint generated by default as identity, name varchar(255) not null, primary key (id) ); ## data.sql INSERT INTO tb_sample (id, name) values (1, 'sample1'); 2. application.yml 수정 ## spring.datasource.schema : schema.sql 파일 지정 ## spring.datasource.dat..
● Spring boot에 H2DB Dependency 추가 1. 아래 링크로 h2db 사이트의 maven dependency 확인 http://h2database.com/html/build.html?highlight=maven&search=maven#maven2 Build Build Portability Environment Building the Software Using Maven 2 Using Eclipse Translating Submitting Source Code Changes Reporting Problems or Requests Automated Build Generating Railroad Diagrams Portability This database is written in Java ..
● 다양한 환경에 적용 할 수 있게 profiles 설정파일을 생성 1. spring 프로젝트의 classpath(/main/resource)안에 'application-dev.yml', 'application-local.yml' 파일을 생성 (추가로 같은 경로에 있는 'application.properties' 파일도 'application.yml' 파일로 이름을 변경) ## '.properties' 확장자 파일과 '.yml' 확장자 파일 둘다 spring에서 인식 할 수 있는 설정 파일의 확장자이다. 다만, '.yml' 파일이 가독성이 좀 더 좋기 때문에 .yml을 선호한다. ## 그냥 application.yml 파일을 어플리케이션 공통으로 적용하는 설정을, application-dev.yml 파일..