Hello,
Using: (v8.3p_2012-11-23/PowerEdition Deployment 2012-11-23)
I have a DMI method, that fetches some rows, with the following MySQL select clause:
The query works. But when I parse results like this, it thinks that the 'r.get("selectedOptions")' is of type byte[]:
Now I have to work-around this by doing:
Which works, but still I thought maybe it is not what you guys intended (ie. it should be String?)
Using: (v8.3p_2012-11-23/PowerEdition Deployment 2012-11-23)
I have a DMI method, that fetches some rows, with the following MySQL select clause:
Code:
<selectClause>Order__orderedProducts_Product.orderedProducts_id, GROUP_CONCAT(ProductOptionValue.ProductOptionValue_id) as selectedOptions</selectClause>
Code:
DSRequest req2 = new DSRequest("Order__orderedProducts_Product","fetch"); Map<String,Object> crit = new HashMap<String,Object>(); //set criteria crit.put("Order__id", req.getFieldValue("Order__id")); crit.put("Product_id", req.getFieldValue("Product_id")); req2.setCriteria(crit); DSResponse resp = req2.execute(); List data = resp.getDataList(); if(data == null || data.size() == 0) return null; for(Object o : data){ Map r = (Map) o; //why is this a byte[]? A (String) cast instead of byte[] cast gave class cast exception byte[] j = (byte[]) r.get("selectedOptions"); }
Code:
byte[] j = (byte[]) r.get("selectedOptions"); String s = new String(j);
Comment