質問編集履歴
1
java のコードを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -38,6 +38,74 @@
|
|
38
38
|
|
39
39
|
|
40
40
|
|
41
|
+
```
|
42
|
+
|
43
|
+
*************************
|
44
|
+
|
45
|
+
JSONObject json = new JSONObject();
|
46
|
+
|
47
|
+
Map<String, List<NamesData>> resultMap = new HashMap<String, List<NamesData>>();
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
// DBから値を取得
|
52
|
+
|
53
|
+
var NameList = Dao.selctNameSearch();
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
var resultList = new ArrayList<NamesData>();
|
58
|
+
|
59
|
+
for(var NameLists : NameList) {
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
// 名前をセット
|
64
|
+
|
65
|
+
var NamesData = new NamesData();
|
66
|
+
|
67
|
+
NamesData.setName(NameLists.getName());
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
// 名前の人の詳細をセット
|
72
|
+
|
73
|
+
var Datas1 = new Data();
|
74
|
+
|
75
|
+
Datas1.setA(NameLists.getA());
|
76
|
+
|
77
|
+
Datas1.setB(NameLists.getB());
|
78
|
+
|
79
|
+
Datas1.setC(NameLists.getC());
|
80
|
+
|
81
|
+
Datas1.setManufacturerName(NameLists.getC());
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
NamesData.getDatas().add(Datas1);
|
86
|
+
|
87
|
+
resultList.add(NamesData);
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
}
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
resultMap.put("allNameData", resultList);
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
json.putAll(resultMap);
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
**********************
|
106
|
+
|
107
|
+
```
|
108
|
+
|
41
109
|
・Mapで作成したのですが、、これだとうまく返せない。
|
42
110
|
|
43
111
|
|