| 131 if(!result_list) { |
131 if(!result_list) { |
| 132 return NULL; |
132 return NULL; |
| 133 } |
133 } |
| 134 // TODO: the class needs a obj destructor func, because we need to be able |
134 // TODO: the class needs a obj destructor func, because we need to be able |
| 135 // to destroy partialy created lists |
135 // to destroy partialy created lists |
| 136 DBUObjectResult result = { |
136 DBUObjectResult result = { |
| |
137 .type = builder->resultType, |
| 137 .userdata1 = result_list, |
138 .userdata1 = result_list, |
| 138 .userdata2 = malloc(builder->resultType->obj_size), |
139 .userdata2 = malloc(builder->resultType->obj_size), |
| 139 .int1 = builder->resultType->obj_size, |
140 .int1 = builder->resultType->obj_size, |
| 140 .create = valuelist_result_create, |
141 .create = valuelist_result_create, |
| 141 .add = list_result_add |
142 .add = list_result_add |
| 304 DBUResultType resultCls = { .cls = fcls }; |
305 DBUResultType resultCls = { .cls = fcls }; |
| 305 cx_array_add(result_types, resultCls); |
306 cx_array_add(result_types, resultCls); |
| 306 } |
307 } |
| 307 if(remaining.length > 2) { |
308 if(remaining.length > 2) { |
| 308 field = cxMapGet(fcls->fields, cx_strsubs(remaining, 2)); |
309 field = cxMapGet(fcls->fields, cx_strsubs(remaining, 2)); |
| |
310 // make sure the field is a normal field and not an obj/list field |
| |
311 if(!field->initValue) { |
| |
312 field = NULL; |
| |
313 } |
| 309 } |
314 } |
| 310 field_mapping[i].cls = fcls; |
315 field_mapping[i].cls = fcls; |
| 311 field_class = fcls; |
316 field_class = fcls; |
| 312 } |
317 } |
| 313 } else { |
318 } else { |
| 314 field = cxMapGet(field_class->fields, fieldname); |
319 field = cxMapGet(field_class->fields, fieldname); |
| |
320 if(field && !field->initValue) { |
| |
321 field = NULL; |
| |
322 } |
| 315 } |
323 } |
| 316 |
324 |
| 317 if(field) { |
325 if(field) { |
| 318 DBUFieldMapping mapping; |
326 DBUFieldMapping mapping; |
| 319 mapping.cls = field_class; |
327 mapping.cls = field_class; |