This is an automated email from the ASF dual-hosted git repository.
isjarana pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-data-lake.git
The following commit(s) were added to refs/heads/master by this push:
new a7fe803 bug fix in update entity
new c359d79 Merge pull request #202 from isururanawaka/mysql_conversion
a7fe803 is described below
commit a7fe803bd60cec77ab04cb26ea2fc64de24fd1fa
Author: Isuru Ranawaka <[email protected]>
AuthorDate: Mon Jan 30 13:10:45 2023 -0500
bug fix in update entity
---
.../apache/airavata/drms/api/handlers/ResourceServiceHandler.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git
a/data-resource-management-service/drms-rdbms-impl/drms-server/src/main/java/org/apache/airavata/drms/api/handlers/ResourceServiceHandler.java
b/data-resource-management-service/drms-rdbms-impl/drms-server/src/main/java/org/apache/airavata/drms/api/handlers/ResourceServiceHandler.java
index 897cbaa..e3943ca 100644
---
a/data-resource-management-service/drms-rdbms-impl/drms-server/src/main/java/org/apache/airavata/drms/api/handlers/ResourceServiceHandler.java
+++
b/data-resource-management-service/drms-rdbms-impl/drms-server/src/main/java/org/apache/airavata/drms/api/handlers/ResourceServiceHandler.java
@@ -254,15 +254,16 @@ public class ResourceServiceHandler extends
ResourceServiceGrpc.ResourceServiceI
Optional<Resource> exResource =
resourceRepository.findById(entityId);
if (exResource.isPresent()) {
-
List<ResourceProperty> resourceProperties =
resourcePropertyRepository.
findByPropertyKeyAndResourceId("owner",exResource.get().getId());
+ if (parentId == null|| parentId.isEmpty())
+ parentId = exResource.get().getParentResourceId();
if (!resourceProperties.isEmpty()) {
Optional<Entity> exEntity =
CustosUtils.mergeResourceEntity(custosClientProvider, callUser.getTenantId(),
parentId, type, entityId,
request.getResource().getResourceName(),
request.getResource().getResourceName(),
resourceProperties.get(0).getPropertyValue());
-
+
if (exEntity.isPresent()) {
Resource resource =
ResourceMapper.map(request.getResource(), exEntity.get(), callUser);
resourceRepository.save(resource);