如何在Mybatis中使用动态表名作为参数 [英] How I Do About Dynamic Table Name As Parameter Using In Mybatis

查看:1471
本文介绍了如何在Mybatis中使用动态表名作为参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于使用mybatis xml select语句查询orable表信息的问题,表名是动态的,作为参数push to mybatis xml,语句就像select * from $ {dynamic tablename}但是它不安全,我怎么能要避免这种情况吗? (该公司不会允许这种不安全的声明)

I have a problem about query orable table infomation using mybatis xml select statement,the table name is dynamic as a parameter push to mybatis xml,the statement like select * from ${dynamic tablename} but it's not safe ,how can i do to avoid this ? (The company will not allow this unsafe statement )

推荐答案

{dynamic tablename}但它不安全,我该怎么做才能避免这种情况? (公司不允许这种不安全的声明)
{dynamic tablename} but it's not safe ,how can i do to avoid this ? (The company will not allow this unsafe statement )


这里 [ ^ ]可能是您最好的选择。

祝你好运。
Here[^] will probably be your best bet.
Good luck.


这篇关于如何在Mybatis中使用动态表名作为参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆