java, mybatis

mybatis 비교시 주의사항 (=="비교대상"로 써야함)

sunny___ 2022. 4. 23. 15:11
반응형

mybatis java.lang.numberformatexception for input string에러가 난데없이 발생

string을 number로 잘못 변환했다는 건데 그런적이 없는데 왜?? 알고보니 아래와 같은 이유였음 

<if test=status=='P' and status=='p'> -> 'p'를 char -> int로 변환하여 비교시 status도 int로 변환되어 에러남

<if test=status=="P" and status=="p"> ->"p"로 해줘야함

반응형