package ge.edu.freeuni.sdp.iot.service.camera_object_recognizer.data;

import com.microsoft.azure.storage.StorageException;
import com.microsoft.azure.storage.table.CloudTable;
import ge.edu.freeuni.sdp.iot.service.camera_object_recognizer.model.ObjectEntity;

public class CloudRepository implements Repository {

    private CloudTable table;

    public CloudRepository(CloudTable table) {
        this.table = table;
    }

    @Override
    public void insertOrUpdate(ObjectEntity task) throws StorageException {

    }


    @Override
    public ObjectEntity delete(String id) throws StorageException {
        return null;
    }

    @Override
    public ObjectEntity find(String id) throws StorageException {
        return null;
    }

    @Override
    public Iterable<ObjectEntity> getAll() {
        return null;
    }
}

@@ -181,82 +181,277 @@
 ort 
-ge.edu.freeuni.sdp.iot.service.camera_object_recognizer.model.ObjectEntity
+com.microsoft.azure.storage.table.TableOperation;%0Aimport com.microsoft.azure.storage.table.TableQuery;%0Aimport ge.edu.freeuni.sdp.iot.service.camera_object_recognizer.model.ObjectEntity;%0Aimport ge.edu.freeuni.sdp.iot.service.camera_object_recognizer.model.ObjectEntityId
 ;%0A%0Ap
@@ -678,12 +678,14 @@
 ity 
-task
+object
 ) th
@@ -708,16 +708,78 @@
 ption %7B%0A
+        table.execute(TableOperation.insertOrReplace(object));
 %0A    %7D%0A%0A
@@ -873,127 +873,580 @@
     
-return null;%0A    %7D%0A%0A    @Override%0A    public ObjectEntity find(String id) throws StorageException %7B%0A        return null
+ObjectEntity object = find(id);%0A        if (object != null) %7B%0A            TableOperation operation = TableOperation.delete(object);%0A            table.execute(operation);%0A        %7D%0A%0A        return object;%0A    %7D%0A%0A    @Override%0A    public ObjectEntity find(String id) throws StorageException %7B%0A        ObjectEntityId objectEntityId = new ObjectEntityId(id);%0A        TableOperation operation = TableOperation.retrieve(%0A                objectEntityId.getPartitionKey(), objectEntityId.getRowKey(), ObjectEntity.class);%0A%0A        return table.execute(operation).getResultAsType()
 ;%0A  
@@ -1524,20 +1524,66 @@
  return 
-null
+table.execute(TableQuery.from(ObjectEntity.class))
 ;%0A    %7D%0A

Implement CloudRepository