Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
fixing issue #46 wrapping Create Update and Delete in a list and foreach
Browse files Browse the repository at this point in the history
  • Loading branch information
James Cullimore committed Feb 19, 2019
1 parent f1ea57a commit 88bad8a
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/main/java/com/manywho/services/sql/controllers/Database.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.manywho.services.sql.controllers;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.Lists;
import com.manywho.sdk.api.run.elements.type.ListFilter;
import com.manywho.sdk.api.run.elements.type.MObject;
import com.manywho.sdk.api.run.elements.type.ObjectDataType;
Expand Down Expand Up @@ -72,7 +73,11 @@ public MObject create(ServiceConfiguration configuration, MObject object) {

@Override
public List<MObject> create(ServiceConfiguration configuration, List<MObject> objects) {
return null;
List<MObject> objectsCreated = Lists.newArrayList();
objects.forEach((object) -> {
objectsCreated.add(create(configuration, object));
});
return objectsCreated;
}

@Override
Expand All @@ -97,8 +102,9 @@ public void delete(ServiceConfiguration configuration, MObject object) {

@Override
public void delete(ServiceConfiguration configuration, List<MObject> objects) {
//todo delete list of object;

objects.forEach((object) -> {
delete(configuration, object);
});
return;
}

Expand Down Expand Up @@ -173,6 +179,10 @@ public MObject update(ServiceConfiguration configuration, MObject object) {

@Override
public List<MObject> update(ServiceConfiguration configuration, List<MObject> objects) {
return null;
List<MObject> objectsUpdated = Lists.newArrayList();
objects.forEach((object) -> {
objectsUpdated.add(update(configuration, object));
});
return objectsUpdated;
}
}

0 comments on commit 88bad8a

Please sign in to comment.