본문 바로가기

Spring17

[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 사용하기 (group_concat 함수) 1. Querydsl 사용 설정 1-1) build.gradle 설정 querydsl-jpa : 실제 애플리케이션에서 Querydsl 을 사용할때 필요한 라이브러리 querydsl-apt : Q 클래스를 만드는 용도 // querydsl 버전 buildscript { ext { queryDslVersion = "5.0.0" } } plugins { id 'org.springframework.boot' version '2.7.3' id 'io.spring.dependency-management' version '1.0.13.RELEASE' id 'java' // querydsl 플러그인 id "com.ewerk.gradle.plugins.querydsl" version "1.0.10" } group = '.. 2022. 10. 19.
[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 + React] react input 데이터 springboot Controller 로 전달하기 React src/pages/SalesRegistrationPage.js TextField 에 input으로 입력받을 numberOfToken 을 useState TextField input 에 입력 후 버튼 클릭 시 이벤트 함수 handleClickRegister (axios로 전달) const [numberOfToken, setNumberOfToken] = useState(); const handleClickRegister = (event, id) => { alert("save"); axios .get("/product/insert", { params: { numberOfToken: numberOfToken }, }) .catch(function () { console.log("실패"); }); co.. 2022. 9. 5.