내 응용 프로그램에서 위반 키가 발생하면 제약 조건 이름을 가져오고 싶지만이 정보를 얻는 방법을 찾지 못하고 있습니다. "getMessage()"에 의해 반환 된 메시지는 매우 요약되어 있으며 최종 사용자에게 사용자 정의 가능한 오류 메시지를 만들기 위해 오류에 대한 추가 정보가 필요합니다.org.springframework.dao.DataIntegrityViolationException에서 제약 조건 이름을 얻는 방법은 무엇입니까?
스택 추적 :
84732 [http-8080-1] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 23505
84732 [http-8080-1] ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: duplicate key value violates unique constraint "ix_tb_oferta_vaga"
Detalhe: Key (cd_pj, cd_curso)=(680, 29) already exists.
187405 [http-8080-1] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 23505
187405 [http-8080-1] ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: duplicate key value violates unique constraint "ix_tb_oferta_vaga"
Detalhe: Key (cd_pj, cd_curso)=(680, 29) already exists.
의 getMessage() :
could not insert: [br.gov.ce.seduc.estagio.model.bean.OfertaVaga]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert: [br.gov.ce.seduc.estagio.model.bean.OfertaVaga]
감사합니다.
아서
을'ERROR : 키 (ORGANIZATION_NAME) = (빌라 대학 QI 캠퍼스 : 중복 키 값 상세 "uk_meb3tm159kt0clyot5mmv8oht"고유 제한 조건을 위반) 이미 존재한다. 최종 사용자에게 메시지를 제공하려는 경우 유용하지 않습니다. –