【发布时间】:2016-09-08 12:22:15
【问题描述】:
我有一个域名TestCase。我正在使用HQL 获取数据,如下所示:-
def query = """
select
tc.testCaseObjective as tco,
tc.testCaseStatus as tcs
from TestCase tc
"""
println TestCase.executeQuery(query, [max: 2])
它给我的输出是:-
[["Test Case 01", "Pass"], ["work order", "Pass"]]
这是List 的List 形式。
但实际上我希望List 的Map 形式为:-
[[tco:"Test Case 01", tcs:"Pass"], [tco:"work order", tcs:"Pass"]]
谁能建议我如何做到这一点?我不想显式转换它。
【问题讨论】:
标签: grails arraylist hashmap hql grails-orm