66import static java .util .Objects .isNull ;
77import static java .util .stream .Collectors .joining ;
88import static java .util .stream .Collectors .toUnmodifiableList ;
9+ import static org .hypertrace .core .documentstore .expression .operators .RelationalOperator .EQ ;
910import static org .hypertrace .core .documentstore .expression .operators .RelationalOperator .IN ;
1011import static org .hypertrace .core .documentstore .model .options .ReturnDocumentType .NONE ;
1112import static org .hypertrace .entity .data .service .v1 .AttributeValue .VALUE_LIST_FIELD_NUMBER ;
@@ -342,7 +343,10 @@ public void update(EntityUpdateRequest request, StreamObserver<ResultSetChunk> r
342343 // Finally, return the selections
343344 List <Document > documents =
344345 getProjectedDocuments (
345- request .getEntityIdsList (), request .getSelectionList (), requestContext );
346+ maybeTenantId .get (),
347+ request .getEntityIdsList (),
348+ request .getSelectionList (),
349+ requestContext );
346350
347351 responseObserver .onNext (
348352 convertDocumentsToResultSetChunk (documents , request .getSelectionList ()));
@@ -531,6 +535,7 @@ private JSONDocument convertToJsonDocument(LiteralConstant literalConstant) {
531535 }
532536
533537 private List <Document > getProjectedDocuments (
538+ final String tenantId ,
534539 final Iterable <String > entityIds ,
535540 final List <Expression > selectionList ,
536541 final RequestContext requestContext )
@@ -550,6 +555,11 @@ private List<Document> getProjectedDocuments(
550555 IdentifierExpression .of (EntityServiceConstants .ENTITY_ID ),
551556 IN ,
552557 ConstantExpression .ofStrings (entityIdList )))
558+ .expression (
559+ RelationalExpression .of (
560+ IdentifierExpression .of (EntityServiceConstants .TENANT_ID ),
561+ EQ ,
562+ ConstantExpression .of (tenantId )))
553563 .build ();
554564
555565 final org .hypertrace .core .documentstore .query .Query query =
0 commit comments