SC_SNAPSHOT-2011-06-06/Pro Deployment 2011-06-06
resultSet.getValueMap always returns a String -> String map.
Observed: "id" field is of type Sequence, yet when valueMap.get(1) is called, there is no result. Instead, if valueMap.get("1") is called, the value is found.
Expected: valueMap returns the correct type of map.
resultSet.getValueMap always returns a String -> String map.
Observed: "id" field is of type Sequence, yet when valueMap.get(1) is called, there is no result. Instead, if valueMap.get("1") is called, the value is found.
Expected: valueMap returns the correct type of map.
Code:
Record record = new Record(); record.setAttribute("id", 1); record.setAttribute("value", "one"); Record[] testData = { record }; final DataSource dataSource = new DataSource(); dataSource.addField(new DataSourceField("id", FieldType.SEQUENCE)); dataSource.addField(new DataSourceField("value", FieldType.TEXT)); dataSource.setClientOnly(true); dataSource.setTestData(testData); dataSource.fetchData(null, new DSCallback() { @Override public void execute(DSResponse response, Object rawData, DSRequest request) { final ResultSet resultSet = new ResultSet(dataSource); resultSet.setInitialData(response.getData()); Map valueMap = resultSet.getValueMap("id", "value"); Object result = valueMap.get(1); Object result2 = valueMap.get("1"); SC.say("result=" + result + "<br>" + "result2=" + result2); } });
Comment