查询DB并以Json格式返回结果的通用Java方法
问题描述:
我要找的东西对我来说似乎很简单,但是我的Google失败了.
What I'm looking for seems pretty straight forward to me, but my googles have failed.
我想要一个允许我运行任何查询并以json格式获取结果的方法.
I want a method that allows me to run any query and get the results in json format.
诀窍是我不希望结果需要Java对象作为流程的一部分(DTO,VO等).
The trick is I don't want the results to need java objects as part of the process (DTOs, VOs, etc).
是否有任何快速/简便/干净的方法?
Any quick/easy/clean ways of doing this?