본문 바로가기

Backend/Spring | SpringBoot

[Spring] Spring Errors

반응형

 

org.springframework.dao.InvalidDataAccessApiUsageException: Executing an update/delete query

➡️ 해결방안

//@Modifying
//@Query(value = "INSERT INTO member (test) VALUES (:test)", nativeQuery = true)
//void saveSocialMember(String testText);
//-> 수정
@Transactional
@Modifying
@Query(value = "INSERT INTO member (test) VALUES (:test)", nativeQuery = true)
void saveSocialMember(String testText);

 

org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: Check constraint violation: "CONSTRAINT_875: ";

➡️해결방안

쿼리문에서 제약조건 위반으로 생긴 에러

쿼리문을 Entity에 걸어준 조건에 맞게 수정하여 해결(이번 경우에는 enum의 요소로 String 대문자를 받았었는데, 요청을 소문자로 해서 발생)

반응형