public enum UserStatus {
ACTIVE,
INACTIVE,
DELETE
}
MODEL file has UserStatus defined as ‘status’
private UserStatus status = null;
In my userMapper.xml
RESULT MAP…
<result property="status" column="status" typeHandler="org.apache.ibatis.type.EnumTypeHandler"/>
INSERT…
#{status, typeHandler=org.apache.ibatis.type.EnumTypeHandler},
UPDATE…
status = #{status, typeHandler=org.apache.ibatis.type.EnumTypeHandler},
I get error that argument type mismatch. The database fields have the String values of ‘ACTIVE’ || ‘INACTIVE’ etc.
Caused by: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: Could not set property 'status' of 'class com.elsevier.topicpages.model.User' with value 'ACTIVE' Cause: java.lang.IllegalArgumentException: argum
ent type mismatch
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:97)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:439)
at jdk.proxy2/jdk.proxy2.$Proxy65.selectList(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224)
--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/46cc00c8-d18e-46d7-9291-abc280c6f8d5n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/bff3cf67-d868-4667-b11e-9810d443a4a6n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/CA%2Buep2Qf8-snVmRSmq_%2BMyJ%3DrJO7Gt9XrbN_vRhRQGK1yKvd8Q%40mail.gmail.com.