So by updating each record would look like this?
Code:
public DSResponse deleteUserDestinationsByIPAddress(DSRequest dsRequest) { DSResponse dsResponse = new DSResponse(); try { DataSource vsd = DataSourceManager.get("videoStreamDestination"); List<VideoStreamDestination> records = vsd.fetch("ipAddress",dsRequest.getFieldValue("ipAddress").toString()); Map criteria = new HashMap(); criteria.put("ipAddress", dsRequest.getFieldValue("ipAddress").toString());/* dsRequest.setAllowMultiUpdate(true); dsRequest.setCriteria(criteria); dsRequest.setFieldValue("deletedFlag",false);*/ //iterate the entity list and make maps out of the objects for(VideoStreamDestination destination : records) { DSRequest updateRequest = new DSRequest("videoStreamDestination",DSOperationType.UPDATE.toString().toLowerCase()); updateRequest.setCriteria(criteria); updateRequest.setFieldValue("deletedFlag",true); updateRequest.execute(); } /*dsRequest.setOperationType(DSOperationType.UPDATE.toString().toLowerCase()); dsRequest.execute();*/ } catch (Exception e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } return dsResponse; }
Comment