Commit fe22a652 by Madhan Neethiraj

ATLAS-3058: fix for failure in saved-search

parent b9642b62
...@@ -44,7 +44,7 @@ public class AtlasSavedSearchDTO extends AbstractDataTransferObject<AtlasUserSav ...@@ -44,7 +44,7 @@ public class AtlasSavedSearchDTO extends AbstractDataTransferObject<AtlasUserSav
private static final String PROPERTY_UNIQUE_NAME = "uniqueName"; private static final String PROPERTY_UNIQUE_NAME = "uniqueName";
private static final String PROPERTY_SEARCH_TYPE = "searchType"; private static final String PROPERTY_SEARCH_TYPE = "searchType";
private static final String PROPERTY_UI_PARAMETERS = "uiParameters"; 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 @Inject
public AtlasSavedSearchDTO(AtlasTypeRegistry typeRegistry) { public AtlasSavedSearchDTO(AtlasTypeRegistry typeRegistry) {
......
...@@ -93,11 +93,16 @@ public class AtlasUserProfileDTO extends AbstractDataTransferObject<AtlasUserPro ...@@ -93,11 +93,16 @@ public class AtlasUserProfileDTO extends AbstractDataTransferObject<AtlasUserPro
AtlasEntity entity = toEntity(obj); AtlasEntity entity = toEntity(obj);
AtlasEntityWithExtInfo entityWithExtInfo = new AtlasEntityWithExtInfo(entity); 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<>(); List<AtlasObjectId> objectIds = new ArrayList<>();
for (AtlasUserSavedSearch ss : obj.getSavedSearches()) { for (AtlasUserSavedSearch ss : obj.getSavedSearches()) {
AtlasEntity ssEntity = savedSearchDTO.toEntity(ss); AtlasEntity ssEntity = savedSearchDTO.toEntity(ss);
ssEntity.setAttribute(AtlasSavedSearchDTO.PROPERTY_USER_PROFILE, userProfileId);
entityWithExtInfo.addReferredEntity(ssEntity); entityWithExtInfo.addReferredEntity(ssEntity);
objectIds.add(new AtlasObjectId(ssEntity.getGuid(), savedSearchDTO.getEntityType().getTypeName(), savedSearchDTO.getUniqueAttributes(ss))); objectIds.add(new AtlasObjectId(ssEntity.getGuid(), savedSearchDTO.getEntityType().getTypeName(), savedSearchDTO.getUniqueAttributes(ss)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment