나는 postgreSQL을 사용합니다. myBatisMapper의 요청은 다음과 같습니다.
<select id="findByStatusAndIdentityAndPrvCode" parameterType="java.lang.String" resultMap="Request">
select
from req_tab
where status in ('I', 'D', 'Q')
and identity = #{identity}
and prv_code = #{prvCode}
limit 1 for update
</select>
내 오류는 다음과 같습니다.
org.apache.ibatis.exceptions.PersistenceException:
Error querying database. Cause: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
The error may exist in ru/infogate/dao/mapper/ReqMapper.xml
The error may involve ru.infogate.dao.mapper.ReqMapper.findByStatusAndIdentityAndPrvCode
The error occurred while handling results
SQL: select from req_tab where status in ('I', 'D', 'Q') and identity = ? and prv_code = ? limit 1 for update
Cause: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
이유는 무엇이며 어떻게 해결합니까?
mysql을 사용할 때 동일한 오류가 발생합니다. 하지만 NoArgsConstructor와 AllArgsConstructor를 모두 추가하여 해결했습니다. lombok의 @Builder를 사용하지만 생성자 주석을 놓쳤습니다. 오류 로그에는 찾을 수없는 메시지가 너무 적습니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다