반응형
반응형
Pageable 이란?Pageable은 Spring Data JPA에서 제공하는 인터페이스로,페이지 정보(페이지 번호, 크기, 정렬 기준 등)를 캡슐화 하는 데 사용된다.이를 통해 대규모 데이터를 페이징하여 효율적으로 처리 및 관리할 수 있다.즉, 페이징 처리를 Pageable 인터페이스를 통해 쉽게 구현 가능하다.PageNumber : 가져오려는 페이지의 번호, 기본적으로 0부터 시작한다.PageSize : 한 페이지에 포함될 데이터의 개수를 의미한다. 기본 개수는 2000개이다.Sort : 결과를 정렬하는 기준을 의미한다. 정렬 기준을 명시하지 않으면 정렬을 하지 않고, 데이터베이스에 가져온 순서대로 결과를 반환한다. Pageable의 페이지를 1부터 시작하게 하려면?기본적으로 PageNumber는 ..
개요보통 application.properties에 환경 설정 기재하여 개발을 진행하고는 하는데,문제는 깃허브 같은 공개된 리파지토리에 프로젝트 파일을 올릴 때 문제가 발생한다.만약, 서버 정보나 데이터베이스 접속 정보가 포함될 경우에는 매우 위험하기 때문이다. 기본 설정 파일의 민감 정보 분리하기추가 설정 파일 만들기기본 설정 파일인 application.properties가 존재하는 같은 경로에민감 정보를 따로 저장할 설정 파일(*.properties)을 하나 새로 추가한다.필자는 데이터베이스의 접속 정보를 분리할 예정이기에 데이터베이스의 접속 정보를 분리하려 한다.파일명의 주어진 작명 형식은 따로 없다.포스팅에서는 application-database.properties라고 하겠다. 추가 설정 파일..
이번 포스팅에서는 nativeQuery로 프로시저를 사용하는 것이 아닌, 직접 프로시저 실행하는 명령어를 이용하여 프로시저를 사용합니다. 예제 파일은 깃허브에서 다운로드 가능합니다. https://github.com/luvris2/spring-boot-jap-stored-procedure-query GitHub - luvris2/spring-boot-jap-stored-procedure-query Contribute to luvris2/spring-boot-jap-stored-procedure-query development by creating an account on GitHub. github.com 사용 환경 IDE : IntelliJ Java : Open JDK 17 Project : Grade ..
Error 웹 서버를 실행시키지 못함 *************************** APPLICATION FAILED TO START *************************** Description: Web application could not be started as there was no org.springframework.boot.web.servlet.server.ServletWebServerFactory bean defined in the context. Action: Check your application's dependencies for a supported servlet web server. Check the configured web application type. Proce..
Error Executing ':Main.main()'... Starting Gradle Daemon... Gradle Daemon started in 667 ms > Task :compileJava FAILED Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. See https://docs.gradle.org/7.5.1/userguide/comma..
예제 파일 https://github.com/luvris2/spring-boot-jap-nativequery GitHub - luvris2/spring-boot-jap-nativequery Contribute to luvris2/spring-boot-jap-nativequery development by creating an account on GitHub. github.com 서론 JPA로 CRUD말고 함수나 프로시저 호출은 어떻게 해야하지? 사용 환경 IDE : IntelliJ Java : Open JDK 17 Project : Grade DB : SSMS (MS-SQL) DB Management : JPA 프로젝트 설정 MS-SQL / JPA 라이브러리 추가 build.grade - dependen..