mysql

스프링 5.7.2부터 WebSecurityConfigurerAdapter가 deprecated 되어 책과 내용이 다릅니다. https://spring.io/blog/2022/02/21/spring-security-without-the-websecurityconfigureradapter 1) 스프링 시큐리티 설정 커스터마이징 SecurityFilterChain 빈을 등록하여 커스터마이징 할 수 있다. HttpSecurity를 파라미터로 받아 리소스 접근 권한을 설정한다. 아래의 코드는 “/index”로 접근은 모두 허용하고, 나머지 리소스는 인증된 사용자만 접근할 수 있도록 한다. 만약 인증 되지 않은 사용자가 접근하면 로그인 페이지로 리다이렉트 시킨다. @Configuration public class ..
스프링 데이터 Repository 인터페이스 public interface Repository {} 메서드나 상수를 포함하고 있지 않고, 오직 객체의 런타임 타입 정보만을 알려주는 마커 인터페이스 도메인 클래스와 도메인 클래스의 식별자 타입 정보를 포함하고 있다. 스프링 데이터 CrudRepository 인터페이스 public interface CrudRepository extends Repository {} Repository 인터페이스를 상속받은 하위 인터페이스 CRUD 연산을 포함 주요 메서드 S save(S entity) : 주어진 엔티티를 저장한다. Optional findById(ID id) : ID로 엔티티를 조회한다. Iterable findAll() : 모든 엔티티를 조회한다. long ..
들어가기에 앞서.. 책은 H2 데이터베이스를 예제로 다루고 있으나, 이 글에서는 Mysql을 사용하였습니다. [사전준비] MAC에 Mysql 설치 터미널을 통해 설치 한다. > brew update > brew install mysql > mysql --version mysql Ver 8.3.0 for macos13.6 on arm64 (Homebrew) > mysql.server start Starting MySQL SUCCESS! > mysql_secure_installation 초기설정 작업 수행 > mysql -u root -p Enter password: [비밀번호 입력] Welcome to the MySQL monitor. Commands end with ; or \\g. Your MySQL ..
yewonS2
'mysql' 태그의 글 목록