|
|
@@ -108,6 +108,8 @@ public class DataSourcesDataAccess {
|
|
108
|
108
|
dataSourceDbo.addStoredProcedure(spDbo);
|
|
109
|
109
|
DataHolder<Integer> position = new DataHolder<>();
|
|
110
|
110
|
position.data = 0;
|
|
|
111
|
+ TableDataSourceDbo returnType = new TableDataSourceDbo();
|
|
|
112
|
+ returnType.setName(spDbo.getName());
|
|
111
|
113
|
sp.getArguments().forEach(o ->
|
|
112
|
114
|
{
|
|
113
|
115
|
SqlTypeDbo sqlTypeDbo = new SqlTypeDbo();
|
|
|
@@ -116,8 +118,6 @@ public class DataSourcesDataAccess {
|
|
116
|
118
|
|
|
117
|
119
|
DasArgument.Direction dir = o.getArgumentDirection();
|
|
118
|
120
|
|
|
119
|
|
-
|
|
120
|
|
-
|
|
121
|
121
|
if (dir.isReturnOrResult()) {
|
|
122
|
122
|
spDbo.setSqlType(sqlTypeDbo);
|
|
123
|
123
|
}
|
|
|
@@ -125,14 +125,33 @@ public class DataSourcesDataAccess {
|
|
125
|
125
|
StoredProcedureArgDbo argDbo = new StoredProcedureArgDbo();
|
|
126
|
126
|
argDbo.setName(o.getName().isEmpty() ? "arg" + position.data : o.getName());
|
|
127
|
127
|
argDbo.setSqlType(sqlTypeDbo);
|
|
128
|
|
- argDbo.setOut(o.getArgumentDirection().isOut());
|
|
129
|
128
|
spDbo.addArgument(argDbo);
|
|
130
|
129
|
++position.data;
|
|
131
|
130
|
}
|
|
|
131
|
+ if (dir.isOut()) {
|
|
|
132
|
+ ColumnDataSourceDbo field = new ColumnDataSourceDbo();
|
|
|
133
|
+ field.setSelected(true);
|
|
|
134
|
+ field.setPrimary(false);
|
|
|
135
|
+ field.setDefaultValue(null);
|
|
|
136
|
+ field.setNotNull(false);
|
|
|
137
|
+ field.setName(o.getName());
|
|
|
138
|
+ field.setSqlType(sqlTypeDbo);
|
|
|
139
|
+ returnType.addColumn(field);
|
|
|
140
|
+ }
|
|
132
|
141
|
});
|
|
133
|
|
-// DasArgument arg = sp.getReturnArgument();
|
|
134
|
|
-// if (arg != null)
|
|
135
|
|
-// arg.toString();
|
|
|
142
|
+ if (returnType.getColumns().size() > 1) {
|
|
|
143
|
+ boolean isSetOf = sp.getReturnArgument().getDataType().typeName.startsWith("setof ");
|
|
|
144
|
+ SqlTypeDbo sqlTypeDbo = new SqlTypeDbo();
|
|
|
145
|
+ sqlTypeDbo.setType((isSetOf ? "setof " : "" ) + returnType.getName());
|
|
|
146
|
+ sqlTypeDbo.setVagueArg(null);
|
|
|
147
|
+ spDbo.setSqlType(sqlTypeDbo);
|
|
|
148
|
+ dataSourceDbo.addType(returnType);
|
|
|
149
|
+ }
|
|
|
150
|
+ else {
|
|
|
151
|
+ DasArgument returnArg = sp.getReturnArgument();
|
|
|
152
|
+ if (returnArg != null) {
|
|
|
153
|
+ }
|
|
|
154
|
+ }
|
|
136
|
155
|
}
|
|
137
|
156
|
});
|
|
138
|
157
|
return dataSourceDbo;
|