How can you add values to a collection type attribute and Map from Impex in Hybris ?

1. For Collection type attribute you can use comma separated values which are to be inserted.

eg. INSERT_UPDATE UserGroup;uid[unique=true];groups(uid)[mode=append];readableLanguages(isocode);writeableLanguages(isocode);
;base-electronics-cmsmanagergroup;basecmsmanagergroup;ja,en,de,zh;ja,en,de,zh



Here , both readableLanguages and writeableLanguages are of type LanguageCollection .

2. Also you can use mode=append in header for Collection Type attribute .



3. For Map type attribute by default you have to use -> delimiter within key and value pair .

INSERT_UPDATE myProduct;myAttribute
;myKey->myValue

Java Program To Remove Duplicate Elements From ArrayList without using Collections



package com.javainhouse;

import java.util.ArrayList; 
public class RemoveDuplicates {
public static void main(String[] args)
{

 ArrayList<Object> al = new ArrayList<Object>(); 
 al.add("java"); 
 al.add('a');
 al.add('b');
 al.add('a');
 al.add("java");
 al.add(10.3); 
 al.add('c'); 
 al.add(14); 
 al.add("java"); 
 
 al.add(12); 
 System.out.println("Before Remove Duplicate elements:"+al);

 for(int i=0;i<al.size();i++)
 { 
 
for(int j=i+1;j<al.size();j++)
if(al.get(i).equals(al.get(j)))
al.remove(j); j--; 
System.out.println("After Removing duplicate elements:"+al);
}
}