You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ma...@apache.org on 2019/02/27 06:12:09 UTC

[atlas] branch branch-1.0 updated: ATLAS-3058: fix for failure in saved-search

This is an automated email from the ASF dual-hosted git repository.

madhan pushed a commit to branch branch-1.0
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/branch-1.0 by this push:
     new 5abd615  ATLAS-3058: fix for failure in saved-search
5abd615 is described below

commit 5abd615a1c8d8f33ccf8349d14d4894cb38cb96a
Author: Madhan Neethiraj <ma...@apache.org>
AuthorDate: Tue Feb 26 20:46:28 2019 -0800

    ATLAS-3058: fix for failure in saved-search
    
    (cherry picked from commit fe22a652c1a29c6df24bd906f6f62c9a76c2ddc0)
---
 .../apache/atlas/repository/ogm/profiles/AtlasSavedSearchDTO.java    | 2 +-
 .../apache/atlas/repository/ogm/profiles/AtlasUserProfileDTO.java    | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/repository/src/main/java/org/apache/atlas/repository/ogm/profiles/AtlasSavedSearchDTO.java b/repository/src/main/java/org/apache/atlas/repository/ogm/profiles/AtlasSavedSearchDTO.java
index 1a24e67..b0a2b74 100644
--- a/repository/src/main/java/org/apache/atlas/repository/ogm/profiles/AtlasSavedSearchDTO.java
+++ b/repository/src/main/java/org/apache/atlas/repository/ogm/profiles/AtlasSavedSearchDTO.java
@@ -44,7 +44,7 @@ public class AtlasSavedSearchDTO extends AbstractDataTransferObject<AtlasUserSav
     private static final String PROPERTY_UNIQUE_NAME       = "uniqueName";
     private static final String PROPERTY_SEARCH_TYPE       = "searchType";
     private static final String PROPERTY_UI_PARAMETERS     = "uiParameters";
-    private static final String PROPERTY_USER_PROFILE      = "userProfile";
+    public  static final String PROPERTY_USER_PROFILE      = "userProfile";
 
     @Inject
     public AtlasSavedSearchDTO(AtlasTypeRegistry typeRegistry) {
diff --git a/repository/src/main/java/org/apache/atlas/repository/ogm/profiles/AtlasUserProfileDTO.java b/repository/src/main/java/org/apache/atlas/repository/ogm/profiles/AtlasUserProfileDTO.java
index 982d646..3ab0af5 100644
--- a/repository/src/main/java/org/apache/atlas/repository/ogm/profiles/AtlasUserProfileDTO.java
+++ b/repository/src/main/java/org/apache/atlas/repository/ogm/profiles/AtlasUserProfileDTO.java
@@ -93,11 +93,16 @@ public class AtlasUserProfileDTO extends AbstractDataTransferObject<AtlasUserPro
         AtlasEntity            entity            = toEntity(obj);
         AtlasEntityWithExtInfo entityWithExtInfo = new AtlasEntityWithExtInfo(entity);
 
+        AtlasObjectId userProfileId = new AtlasObjectId(entity.getGuid(), AtlasUserProfileDTO.ENTITY_TYPE_NAME,
+                                                        Collections.singletonMap(AtlasUserProfileDTO.PROPERTY_USER_NAME, obj.getName()));
+
         List<AtlasObjectId> objectIds = new ArrayList<>();
 
         for (AtlasUserSavedSearch ss : obj.getSavedSearches()) {
             AtlasEntity ssEntity = savedSearchDTO.toEntity(ss);
 
+            ssEntity.setAttribute(AtlasSavedSearchDTO.PROPERTY_USER_PROFILE, userProfileId);
+
             entityWithExtInfo.addReferredEntity(ssEntity);
 
             objectIds.add(new AtlasObjectId(ssEntity.getGuid(), savedSearchDTO.getEntityType().getTypeName(), savedSearchDTO.getUniqueAttributes(ss)));