将MyBatis与Oracle XMLType函数"existsNode()"一起使用时,

编程入门 行业动态 更新时间:2024-10-28 20:31:15
本文介绍了将MyBatis与Oracle XMLType函数"existsNode()"一起使用时,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有以下情况. 这是我的mybatis sql语句:

i have following situation. this is my mybatis sql statement:

<select id="select" parameterType="String" resultMap="urlList"> select x.t002_id from t002_metadata x where existsNode(x.t002_xml, ?) = 1; </select>

因此,当我从包装类中调用select方法并使用xpath表达式设置字符串参数时,将显示以下错误消息:

so when i'm calling the select method from the wrapper class and set the string parameter with a xpath expression, the following error message shows up:

Missing IN or OUT parameter at index:: 1

mybatis是否不可能使用oracle中的existNode方法编写准备好的语句?

Is it not possible for mybatis to make a prepared statement with existNode method from oracle??

提前谢谢!

推荐答案

有可能.您不应该编码吗?到您的MyBatis xml中. MyBatis对于动态sql具有特殊的语言,建议您阅读《 MyBatis 3用户指南》 .

It is possible. You shouldn't code the ? into your MyBatis xml. MyBatis has special language for dynamic sql, I suggest reading the MyBatis 3 User Guide.

更改您的sql映射,

<select id="select" parameterType="String" resultMap="urlList"> select x.t002_id from t002_metadata x where existsNode(x.t002_xml, #{id}) = 1; </select>

它可能不是#{id},这取决于您如何调用Mybatis中的select.例如,您可能正在使用@Param标记.

It might not be #{id}, it depends on how you call select from Mybatis. For example, you might be using the @Param tag.

更多推荐

将MyBatis与Oracle XMLType函数"existsNode()"一起使用时,

本文发布于:2023-08-04 01:30:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1291696.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:函数   Oracle   MyBatis   XMLType   existsNode

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!