SPRING 5

[JPA] Pagaeable 다중 sort 방법

[JPA] Pagaeable 다중 sort 방법 Pagaeable 한개의 sort @PageableDefault(size = 10, sort = "semester", direction = Sort.Direction.ASC) Pageable pageable 설명) @PageableDefault() 안에 sort="sort할 변수 명" direction = "오름차순, 내림차선 설정" Pagaeable 다중 sort @PageableDefault(size = 10) @SortDefault.SortDefaults( { @SortDefault(sort = "semester", direction = Sort.Direction.ASC) , @SortDefault(sort = "courseNm", direction ..

SPRING/JPA 2021.10.26

[JPA] Hibernate Entity는 대문자인데 소문자로 쿼리 실행할 때

[JPA] Hibernate Entity는 대문자인데 소문자로 쿼리 실행할 때 .findAll() 하는데 자꾸 소문자로 실행해서 consol에 쿼리를 DB 툴에서 Table 명을 대문자로 해서 실행했더니 잘된다.... 검색해봤더니 hibernate가 소문자로 바꿔서 한다고.... 설정은 간단했다. application.yml 에 설정만 추가해주면 된다. hibernate: naming: physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl implicit-strategy: org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl

SPRING/JPA 2021.03.25

[JPA ERROR] org.spring.framework.orm.jpa.JpaSystemException: Null value was to a property

[JPA] org.spring.framework.orm.jpa.JpaSystemException: Null value was to a property error error : org.spring framework.orm.jpa.JpaSystemException: Null value was to a property 해석 : 속성에 Null 값이 할당되었습니다. 해결 방안 검색해 보았더니 error 끝에 칼럼이 명시되어 있는데 해당 칼럼이 null값이 들어갈 수 있게 설정이 되어있는데 JAVA에서는 Primitive Type(boolean, byte, short, int, long, float, double, char) 으로 지정되어 있어 발생한 error라고 한다. 난 해당 칼럼의 Entity 변수가 in..

SPRING/JPA 2021.03.24