본문 바로가기

분류 전체보기

(297)
JOIN 완전 정리 (INNER JOIN, OUTER JOIN, LEFT JOIN, RIGHT JOIN) 예제 테이블mysql> select * from demo_people; name phone pid Mr brown 01225 708225 1 Miss Smith 01225 899360 2 Mr Pullen 01380 724040 3 mysql> select * from demo_property; pid spid selling 1 1 Old House Fram 3 2 The Willows 3 3 Tali Trees 3 4 the Melksham Florist 4 5 Dun Roamin 1. 기본 JOIN (= INNER JOIN) - 기본적으로 JOIN은 교집합이다. mysql> select name, phone, selling from demo_people join demo_property on demo..
[IntelliJ] java: cannot find symbol(클래스 import가 안될 때) 📎 [IntelliJ] java: cannot find symbol GitHub에서 프로젝트를 Clone한 뒤 실행하는데 다음과 같은 오류가 발생했습니다. 다른 클래스가 import가 되지 않는 현상인데요, 아래 방법을 통해 해결할 수 있습니다. 🎯 해결 방법 (1) Build > Rebuild Project 화면 상단의 Build > Rebuild Project 를 클릭합니다. 위 방법으로는 해결이 안되네요 .. 😭 (2) File > Invalidate Caches... 화면 상단의 File > Invalidate Caches... 를 클릭합니다. 위 창에서 INVALIDATE AND RESTART 를 클릭합니다. 굳 저는 위 Invalidate Caches... 방법으로 해결되었습니다 😃 Refe..
IntelliJ cannot resolve symbol.. 에러 해결 문제 IntelliJ IDEA를 쓰고 있으며, 멀쩡히 잘 쓰다가 종종 잊을만하면 Cannot resolve symbol.. 에러가 나온다. 예를 들면 아래와 같이 import가 제대로 안되는 것이다. cannot resolve symbol import org.openjdk.jmh.runner.options.Options; build.gradle 설정을 제대로 안해줬나? 싶어서 암만 뒤져봐도 잘못된게 없어보이고, 한참 생각하다가 ‘아 또 그거냐..하..’ 하게 되는에러다. 매번 검색하기 귀찮아서 따로 정리해두기로 했다. 해결 1차 시도 상단 메뉴바에서 Build > Clean Project 하고나서 Build > Rebuild Project를 한다. 2차 시도 1차 시도로 해결이 안되면 캐시를 비우고 재실..
MacOS 에서 H2 database 설치 및 Spring Boot 에 연결 1. H2 Database 홈페이지에서 다운로드 다운로드 링크 : https://www.h2database.com/html/main.html 최신 버전보다는 안정화된 버전이 괜찮습니다. 2. 압축 풀고 실행 다운 받은 파일의 압축을 풀면 다음과 같은 구성으로 되어 있습니다. 여기서 ./bin/h2.sh 를 입력하면 h2 console 을 실행합니다. 만약 권한이 없으면 chmod 755 ./bin/h2.sh 로 권한을 부여합니다. 3. 한번 연결해서 ~.mv.db 파일 생성 후 실행 처음 진입하면 아래와 같은 화면이 나옵니다. 다른 칸은 전부 그대로 두고 JDBC URL 부분만 표시한 것처럼 바꿔줍니다. 그리고 연결 버튼을 눌러서 진입합니다. 그럼 다음과 같이 내 Root 폴더에 my-db-test.mv..
[Lombok] @Builder 사용 시 @NoArgsConstructor 관련 에러 해결 Spring Boot로 개발 시 Lombok의 @Builder를 사용할 때 자주 마주치는 에러가 있다. 바로.. 아래와 같은 에러 ! 에러 Error:(7, 1) java: constructor MyName in class kr.leocat.test.MyName cannot be applied to given types; required: no arguments found: java.lang.String,java.lang.String reason: actual and formal argument lists differ in length 원인 원인은 @Builder를 사용 시 @NoArgsConstructor 어노테이션을 함께 사용해서 에러가 발생한다. 모든 멤버변수를 받는 생성자가 없는 것이 이유이다. ..
[JPA] Spring Data JPA와 QueryDSL 이해, 실무 경험 공유 Spring Data JPA와 QueryDSL JPA 기반 프로젝트 Spring Data JPA QueryDSL Spring Data JPA 지루하게 반복되는 CRUD 문제를 세련된 방법으로 해결 개발자는 인터페이스만 작성한다 스프링 데이터 JPA가 구현 객체를 동적으로 생성해서 주입 스프링 데이터 JPA 적용 전public class MemberRepository { public void save(Member member) {...} public Member findOne(Long id) {...} public List findAll() {...} public Member findByUsername(String username) {...} }public class ItemRepository { publ..
Spring Data JPA 사용 시 deleteById 와 delete 의 차이 Spring Data 란? Spring Data’s mission is to provide a familiar and consistent, Spring-based programming model for data access while still retaining the special traits of the underlying data store. It makes it easy to use data access technologies, relational and non-relational databases, map-reduce frameworks, and cloud-based data services. This is an umbrella project which contains many subprojec..
[ERROR] Can not issue data manipulation statements with executeQuery(). @Modifying 사용하기 Can not issue data manipulation statements with executeQuery(). Servlet.service() for servlet [dispatcherServlet] in context with path threw exception [Request processing failed; nested exception is org.springframework.orm.jpa.JpaSystemException: could not extract ResultSet; nested exception is org.hibernate.exception.GenericJDBCException: could not extract ResultSet] with root cause @Query(valu..