6월, 2021의 게시물 표시

Spring-boot & mybatis & mysql - java.sql.SQLException: Incorrect integer value: 'string_value' for column 'column_name' at row 1

Error using Enum Type in Spring-boot, Mysql, Mybatis environment. Incorrect integer value: 'string_value' for column 'column_name' at row 1 Java Person class public class Person { private int id ; private String name ; private AgeType age ; private String email ; } public enum AgeType { One ( 1 , " 일 " ) , Two ( 2 , " 이 " ) , Three ( 3 , " 삼 " ) , Four ( 4 , " 사 " ) , Five ( 5 , " 오 " ) ; } Mysql DB Person table +-----------------------+ | Tables_in_spring-boot | +-----------------------+ | Person | +-----------------------+ 1 row in set (0.01 sec) mysql> desc Person; +-------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+-------------+------+-----+---------+----------------+ | id | int | NO | PRI | NULL | auto_increment | | name | varchar(30) | NO | | NULL