본문 바로가기

Java137

[해결방법] JdbcTypeRecommendationException JdbcTypeRecommendationException Environment Language: Java DB: H2 Database IDE: IntelliJ Problem @Entity를 선언하고 table을 create할 때 발생 Caused by: org.hibernate.type.descriptor.java.spi.JdbcTypeRecommendationException: Could not determine recommended JdbcType for Java type 'jpabook.jpashop.domain.Delivery' Cause of Problem Hibernate가 엔티티의 필드에 대한 JDBC 타입을 결정하지 못할 때 발생 엔티티 필드와 데이터베이스 컬럼 간의 매핑이 충분히 명시되지.. 2023. 12. 25.
[해결방법] BeanCreationException BeanCreationException Environment Language: Java DB: H2 Database IDE: IntelliJ Problem Entity에서 PK에 @Id를 설정하고, @GeneratedValue를 통해 자동으로 값을 부여하고자 할 때 발생 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: [PersistenceUnit: defau.. 2023. 12. 25.
[해결 방법] error: no suitable method found for ... 👉 기본 환경 - Language: Java - IDE: Sublime ⌨️ 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 import java.util.Arrays; import java.util.Collections; class Solution { public String solution(String s) { String answer = ""; char[] sToCharArr = new char[s.length()]; for(int i=0; i-1; i--){ sb.append(sToCharArr[i]); } answer = sb.toString(); return answer; } } 🖨️오류 1 2 3 4 5 6 7 8 9 10 11 12 13.. 2023. 10. 17.
[해결 방법] org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl ... is closed 👉 기본 환경 - Language: Java - DB: H2 Database - IDE: IntelliJ 테스트 코드가 안돌아갑니다. Transaction이 closed 됐다고 안돌아갑니다😖. ⌨️ 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 @SpringBootTest public class PostServiceTest { @Autowired private PostService postService; @Autowired private PostRepository postRepository; @Test public void DTO데이터_POST테이블_조회(){ // given PostSaveDTO.. 2023. 10. 8.
[해결 방법] Could not find javax.servlet:jstl 👉 기본 환경 - Language: Java - DB: MySQL - IDE: IntelliJ ⌨️ 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 plugins { id 'java' id 'org.springframework.boot' version '3.1.4' id 'io.spring.dependency-management' version '1.1.3' } group = 'com.project' version = '0.0.1-SNAPSHOT' java { sourceCompatibility = '17' } configuration.. 2023. 10. 3.
[JPA_Basic] Bulk 연산 이 글은 김영한의 [자바 ORM 표준 JPA 프로그래밍 - 기본편]을 수강하며 정리한 글입니다. 👉 기본 환경 - Language: Java - DB: H2 Database - IDE: IntelliJ Bulk 연산 ⌨️ 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 public class Main { public static void main(String[] args) { // 생략 try { Team teamA = new Team(); teamA.setName("Te.. 2023. 9. 29.