我用数据库PostgreSQL,有个表中的主键是uuid类型(A字段),现在在工程中项相应的Bean文件中该字段A的类型是String,想要根据一个得到的主键值去查询。
Mybatis中的查询是
<select id="selectXXX" parameterType="String" resultMap="hsJsglMap">
select * from XXX where id = #{Id}
</select>
得到的错误信息是org.postgresql.util.PSQLException uuid = character varying,有没有解决方案??谢谢大家
MyBatis
select * from XXX where id::uuid = #{Id},sql改成这样