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

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


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

commit fe22a652c1a29c6df24bd906f6f62c9a76c2ddc0
Author: Madhan Neethiraj <[email protected]>
AuthorDate: Tue Feb 26 20:46:28 2019 -0800

    ATLAS-3058: fix for failure in saved-search
---
 .../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)));

Reply via email to