Skip to content
Snippets Groups Projects
Verified Commit baf56de6 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

WIP: multi-retrieve

parent c7d76423
No related branches found
No related tags found
2 merge requests!44Release 0.6,!43Merge f-GRPC-main to dev
Pipeline #11067 passed
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.caosdb</groupId> <groupId>org.caosdb</groupId>
<artifactId>caosdb-server</artifactId> <artifactId>caosdb-server</artifactId>
<version>0.5.0-GRPC0.0.7</version> <version>0.5.0-GRPC0.0.8</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>CaosDB Server</name> <name>CaosDB Server</name>
<scm> <scm>
......
...@@ -218,6 +218,19 @@ public class EntityTransactionServiceImpl extends EntityTransactionServiceImplBa ...@@ -218,6 +218,19 @@ public class EntityTransactionServiceImpl extends EntityTransactionServiceImplBa
final RetrieveEntity entity = new RetrieveEntity(getId(id)); final RetrieveEntity entity = new RetrieveEntity(getId(id));
container.add(entity); container.add(entity);
} catch (final NumberFormatException e) {
// We handle this after the retrieval
}
}
final Retrieve transaction = new Retrieve(container);
transaction.execute();
for (final TransactionRequest sub_request : request.getRequestsList()) {
final String id = sub_request.getRetrieveRequest().getId();
try {
final EntityInterface entity = container.getEntityById(getId(id));
builder.addResponses( builder.addResponses(
TransactionResponse.newBuilder() TransactionResponse.newBuilder()
.setRetrieveResponse(RetrieveResponse.newBuilder().setEntity(convert(entity)))); .setRetrieveResponse(RetrieveResponse.newBuilder().setEntity(convert(entity))));
...@@ -230,10 +243,6 @@ public class EntityTransactionServiceImpl extends EntityTransactionServiceImplBa ...@@ -230,10 +243,6 @@ public class EntityTransactionServiceImpl extends EntityTransactionServiceImplBa
RetrieveResponse.newBuilder().setEntity(entityDoesNotExist(id)))); RetrieveResponse.newBuilder().setEntity(entityDoesNotExist(id))));
} }
} }
final Retrieve transaction = new Retrieve(container);
transaction.execute();
return builder.build(); return builder.build();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment