728x90 Programming/Spring2 [Spring][오류노트] QueryDSL fetchJoin 오류 해결 !! 본 글은 실무에서 발생한 이슈를 바탕으로 작성되었으나, 회사 보안으로 도메인 구조 및 코드 일부를 재구성하여 설명 !!1. 발생한 에러 로그org.springframework.dao.InvalidDataAccessApiUsageException:org.hibernate.query.SemanticException:Query specified join fetching, but the owner of the fetched associationwas not present in the select list[SqmSingularJoin(ParentEntity(parent).childEntity(child).grandChildEntity(grandChild) : grandChild)] -> QueryDSL에서 .. 2026. 3. 3. [Spring][오류 노트] DataIntegrityViolationException 오류 발생 (Feat. @Transactional 누락) 자세한 코드는 공개 불가 🥹📌 문제 상황 엔티티를 저장하려고 할 때, 다음과 같은 오류가 발생했다.org.springframework.dao.DataIntegrityViolationException: could not execute statement [Column 'create_dtm' cannot be null]해당 필드는 엔티티 생성자에서 분명히 설정되었고, 로그에서도 값이 올바르게 출력되고 있었지만, 여전히 DB에선 null 값이 삽입되며 에러가 났다. ❗ 문제 원인@Transactional 어노테이션이 메서드에 누락되어 있었던 것이 핵심 원인 !! Spring Data JPA에서는 save()를 호출하면 즉시 DB에 INSERT를 수행하는 것이 아니라, 영속성 컨텍스트에 등록(persist)만.. 2025. 5. 9. 이전 1 다음 728x90