mybatis-postgres boolean 문제
mybatis 에서 Boolean인 속성 'myBool' 이 있을때 #{myBool} 은 0 또는 1로 표시됨 ${myBool} 은 false 또는 true 로 표시됨 postgres 컬럼 데이터타입 bit 인 경우 값은 b'0' 이나 b'1' 이라고 입력해야 함. 이걸 insert, update 쿼리에 그대로 b'#{myBool}' 로 표현하면 오류가 발생함. * 해결 컬럼 데이터타입 bool 로 선언 mybatis 에서 가져올때는 # 대신 ${myBool} 을 사용해서 가져옴
SW개발/Database
2020. 3. 24. 15:38
mybatis - postgres numeric column 에 null 대입시 오류
org.postgresql.util.PSQLException: ERROR: column "disp_seq" is of type numeric but expression is of type character varying Hint: You will need to rewrite or cast the expression. Position: 297 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2284) ~[postgresql-9.4.1208.jar:9.4.1208] at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl..
카테고리 없음
2020. 3. 24. 15:32