spring - MyBatis 嵌套选择为空白,带有 UUID 输入参数
问题描述
我的 MyBatis 关联通过嵌套选择返回一个空的结果集。
传递给嵌套选择的参数是来自 Oracle 数据库中 RAW 数据类型列的 UUID。
您可以在下面看到,我正在尝试将“cfg_one_key”列值传递给嵌套选择,以匹配嵌套选择查询中名称略有不同的列 (cfg_one_pk)。
我没有看到任何错误,但我没有得到任何结果。当我使用 DB 可视化应用程序直接查询数据库时,我看到了一个结果。
所以,我想知道是否不能使用 UUID 值进行嵌套选择?
<resultMap id="cfgsMap" type="Cfgs">
<association property="cfgOne" javaType="CfgOne">
<id property="cfgOneKey" column="cfg_one_key"/>
<result property="cfgOneLabel" column="cfg_one_label"/>
<result property="cfgOneLastModified" column="cfg_one_last_modified"/>
</association>
<collection property="cfgTwo" column="cfg_one_key" ofType="CfgTwo" select="selectCfgTwo"/>
</resultMap>
<select id="selectCfgOne" resultMap="cfgsMap">
SELECT cfg_one_key, cfg_one_label, cfg_one_last_modified
FROM cfg_one
WHERE is_latest = 'Y' AND cfg_one_label = 'Dummy Config'
</select>
<select id="selectCfgTwo" resultType="CfgTwo">
SELECT cfg_two_key, cfg_two_label, cfg_two_last_modified
FROM cfg_two
WHERE cfg_one_pk = #{cfg_one_key}
</select>
解决方案
推荐阅读
- python - 如何比较熊猫中的两行(跨所有列),并对输出求和?
- django - Github oauth apache2 django daphne python-social-auth | 身份验证失败...redirect_uri
- matlab - MATLAB:指定点的颜色时,图例不匹配
- r - 用扫帚按组从回归中检索整齐的结果
- authentication - Tomcat 作为客户端身份验证
- html -
- html - 滚动填充属性不会阻止元素接触弹性容器边缘的边缘
- r - 有没有更简单的方法可以按日期查找某个因素的比例?
- docker - mem_limit 没有得到 docker-compose 的认可?
- spring - 每秒甚至不到一秒安排简单的 GET 批处理 - 应该选择 Spring Cloud Task、Spring Batch 或 springframework.scheduling