Spring37 [IntelliJ/Spring] 단축키 모음 command + p : Parameter Info command + option + v : introduce Variable (반환 타입) option + enter : show Context Action command + option + n : inline 단축키 control + t : 검색 F2 : 오류 난 곳으로 이동 command + shift + T : 테스트 코드 만들기 option + enter : Assertions static으로 만들기 command + option + v : 타입 자동 완성 command + e : 히스토리 command + e + enter : 이전으로 돌아가기 command + option + M : extract method ctrl + r : 기존의 마지막 .. 2023. 8. 27. [Spring/Error] ids for this class must be manually assigned before calling save(): Spring, JPA 사용 시 ids for this class must be manually assigned before calling save(): 에러 발생 save() 함수 호출 전 id 값이 설정되어 있어야 함을 의미. 해결방법 DB에서 id 값을 Auto Increment 로 했을 때 entity 에서도 @GeneratedValue 어노테이션이 설정되어 있어야 한다. 참고 : https://hangjastar.tistory.com/241 2023. 2. 1. [Spring/Error] Not a managed type: class 명 error JPA 사용 시 Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: 에러 발생 해결방법 해당 class에 @Entity 어노테이션 추가 참고 : https://wakestand.tistory.com/742 2023. 1. 25. [Spring] JPA Querydsl Unsupported expression Querydsl Unsupported expression 오류 해결 방법 .as()를 통해 alias 사용하기 qHolding.goods_cnt.sum().as("sumGoodsCnt"), Expressions.stringTemplate("group_concat({0})", qHolding.user.user_id).as("userIds") GoodsHoldingDto.java public class GoodsHoldingDto { private Long goodsId; private String goodsNm; private Integer sumGoodsCnt; private String userIds; @QueryProjection public GoodsHoldingDto(Long goodsId, St.. 2022. 10. 9. [Spring] inflearn 스프링 입문 - AOP AOP가 필요한 상황 1. 모든 메소드의 호출 시간을 측정하고 싶을 때 기존 방법 - 메소드마다 시작 끝 시간 측정 src/main/java/hello/hellospring/service/MemberService.java public Long join(Member member) { long start = System.currentTimeMillis(); try { // 같은 이름이 있는 중복 회원x validateDuplicateMember(member); // 중복 회원 검증 memberRepository.save(member); return member.getId(); } finally { long finish = System.currentTimeMillis(); long timeMs = finish.. 2022. 9. 16. [Spring] inflearn 스프링 입문 - 스프링 DB 접근 기술 6 스프링 데이터 JPA 인터페이스만으로 개발 완료. 반복적으로 개발해온 CRUD 기능도 스프링 데이터 JPA가 제공. 코드 적을 게 없음. 그냥 쓰면 됨. 스프링부트 + JPA + 스프링 데이터 JPA 프레임워크. 관계형 데이터베이스 사용 시 스프링 데이터 JPA 필수 스프링 데이터 JPA는 JPA를 편리하게 사용하도록 도와주는 라이브러리. JPA 먼저 학습. 실제 운영시 문제들 해결할 수 없음 src/main/java/hello/hellospring/repository/SpringdataJpaMemberRepository.java SpringdataJpaMemberRepository 인터페이스 생성 인터페이스가 인터페이스를 받을 때는 extends JpaRepository T : Member ID: en.. 2022. 9. 15. 이전 1 2 3 4 5 ··· 7 다음