当前位置:网站首页>mapper. Comments in XML files
mapper. Comments in XML files
2022-07-05 15:09:00 【Blue sky ⊙ white clouds】
mapper.xml Notes in the document
Annotation mode
stay mapper.xml In file , The annotation method is <!--existence of query content-->, Direct adoption Java Comments of code way /*existence of query content*/ Will report a mistake , Especially in SQL sentence When this annotation method appears in .
‘ Invalid column index ’bug And solve
You need to verify the data when importing data yesterday , stay mapper Query the data in the table in the file , Will be voided sql Select Java The way , Error will be reported at this time .
<select id="getSeqNameCount" parameterClass="java.util.HashMap" resultClass="java.lang.Integer">
SELECT COUNT(*) COUN FROM tablename A
WHERE A.id=#id# and A.name=#name#
/*SELECT * FROM tablename A WHERE A.id=#id# and A.name=#name#*/
</select>
During parsing, the parameter position will be parsed as a placeholder ‘?’, So now the following sql It will be parsed in the background as follows , But there are only two parameters passed in , So I will report at this time “Caused by: java.sql.SQLException: Invalid column index ”, Because the number of parameters and placeholders passed in varies .
SELECT COUNT(*) COUN FROM tablename A WHERE A.id=? and A.name=?
/*SELECT * FROM tablename A WHERE A.id=? and A.name=?/
summary
1、mapper.xml The annotation method in the document is <!--existence of query content-->;
2、 “Caused by: java.sql.SQLException: Invalid column index ” Errors are generally caused by sql Placeholders in statements cause :
1 The number of incoming parameters is different from the number of placeholders ;
2SQL Placeholders in statements ? It's the Chinese version ;
3SQL Placeholders in statements ? Put in a string ;
边栏推荐
- I collect multiple Oracle tables at the same time. After collecting for a while, I will report that Oracle's OGA memory is exceeded. Have you encountered it?
- Your childhood happiness was contracted by it
- Ctfshow web entry explosion
- Super wow fast row, you are worth learning!
- R 熵权法计算权重及综合得分
- 数据库学习——数据库安全性
- [C question set] of Ⅷ
- 729. My schedule I: "simulation" & "line segment tree (dynamic open point) &" block + bit operation (bucket Division) "
- 基于TI DRV10970驱动直流无刷电机
- 当代人的水焦虑:好水究竟在哪里?
猜你喜欢

PyTorch二分类时BCELoss,CrossEntropyLoss,Sigmoid等的选择和使用

Under the crisis of enterprise development, is digital transformation the future savior of enterprises

Common redis data types and application scenarios

How to paste the contents copied by the computer into mobaxterm? How to copy and paste

Coding devsecops helps financial enterprises run out of digital acceleration

Crud de MySQL

729. My schedule I: "simulation" & "line segment tree (dynamic open point) &" block + bit operation (bucket Division) "

MySQL----函数

Talk about your understanding of microservices (PHP interview theory question)

CPU设计相关笔记
随机推荐
【数组和进阶指针经典笔试题12道】这些题,满足你对数组和指针的所有幻想,come on !
1330: [example 8.3] minimum steps
12 MySQL interview questions that you must chew through to enter Alibaba
浅谈Dataset和Dataloader在加载数据时如何调用到__getitem__()函数
用 Go 跑的更快:使用 Golang 为机器学习服务
ICML 2022 | 探索语言模型的最佳架构和训练方法
maxcompute有没有能查询 表当前存储容量的大小(kb) 的sql?
Photoshop插件-动作相关概念-非加载执行动作文件中动作-PS插件开发
计算中间件 Apache Linkis参数解读
js亮瞎你眼的日期选择器
CODING DevSecOps 助力金融企业跑出数字加速度
Au - delà du PARM! La maîtrise de l'Université de Pékin propose diverse pour actualiser complètement le classement du raisonnement du NLP
Differences between IPv6 and IPv4 three departments including the office of network information technology promote IPv6 scale deployment
爱可可AI前沿推介(7.5)
可视化任务编排&拖拉拽 | Scaleph 基于 Apache SeaTunnel的数据集成
How to solve the problem of garbled code when installing dependency through NPM or yarn
[recruitment position] Software Engineer (full stack) - public safety direction
useMemo,memo,useRef等相关hooks详解
I collect multiple Oracle tables at the same time. After collecting for a while, I will report that Oracle's OGA memory is exceeded. Have you encountered it?
Leetcode: Shortest Word Distance II