Uuid custom typehandler mybatis?

Your problem is right there in your exception.

Your problem is right there in your exception.... There is no getter for property named 'uuid' in 'class java.util. UUID' Use a parameter type of String, and pass in unique id as an argument. You don't need a type handler.

Seems kinda odd answering my own question, but I got some help on the mybatis-users list, so i'd like to share some hints here: Mybatis was trying to "get" a non-existing field: Luckily, one of mybatis developers helped me a while ago, suggesting that the easiest way to get it to work was to add a @Param annotation in the UserMapper to do this thing: public User selectUserByUUID(@Param("uuid") UUID uuid); SELECT * FROM user WHERE uuid = #{uuid, typeHandler=com.collective.persistence.typehandlers. UuidTypeHandler, javaType=uuid, jdbcType=VARCHAR} I was stuck in watching the typehandler configuration, but, if I understood it right, this has not much to do with typehandlers, since they are used to "transport and translate" data between the sql table and the java objects (through setter and getters), while my issue was in the handling of methods' parameters. Hope this helps someone.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions