如何处理在源代码中的巨大的SQL字符串 [英] How to handle HUGE SQL strings in the source code

查看:127
本文介绍了如何处理在源代码中的巨大的SQL字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



这个项目是一个java项目,但这个问题可以可能适用于任何语言。



无论如何,这是我第一次见到这个坏的东西。
代码库是传统的,所以我们可以突然迁移到Hibernate或类似的东西。



如何处理非常大的SQL字符串? p>

我知道它的坏,但我不知道什么是最好的建议解决方案。

解决方案

在我看来,把这些硬编码的值写入存储过程,并从代码引用sprocs可能是高产出和低努力。


I am working on a project currently where there are SQL strings in the code that are around 3000 lines.

The project is a java project, but this question could probably apply for any language.

Anyway, this is the first time I have ever seen something this bad. The code base is legacy, so we can suddenly migrate to Hibernate or something like that.

How do you handle very large SQL strings like that?

I know its bad, but I don't know exactly what is the best thing to suggest for a solution.

解决方案

It seems to me that making those hard-coded values into stored procedures and referencing the sprocs from code instead might be high yield and low effort.

这篇关于如何处理在源代码中的巨大的SQL字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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