如何将对象列表(DTO)作为单个IN参数传递给存储过程 [英] HOW TO pass List of objects(a DTO) as single IN parameter to Stored Procedure

查看:86
本文介绍了如何将对象列表(DTO)作为单个IN参数传递给存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想像在参数中那样传递Dto并在spring jdbc中调用存储过程.这样做有可能吗?

I want to pass Dto as in parameters and call stored procedure in spring jdbc.Is it possible,In doing so?

我想用dto调用存储过程,就像在参数表中一样,而不是设置参数?因为我有很多参数.

I want to call stored procedures with dto as in paratmeters instead of setting parameters?Because I have large number of parameters.

推荐答案

目前,还没有办法在MySQL存储过程和函数中传递(或返回)对象.

At the moment, there is no way to pass (or return) objects in MySQL stored procedures and functions.

但是,MySQL 5.7具有JSON函数,您可以传递 varchar 参数并使用 JSON_EXTRACT 函数提取值.

BUT, MySQL 5.7 have JSON functions, you can pass a varchar parameter and extract values using JSON_EXTRACT function.

请参阅MySQL 5.7手册:搜索JSON值的函数

这篇关于如何将对象列表(DTO)作为单个IN参数传递给存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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