on ‎2015 Jan 13 5:57 AM
Hi Team,
I have a requirement to create an attribute of Map> type for my productConcept model. I was trying to do like the below one and other 2 ways
<maptype code="ParamTypeMap"
argumenttype="java.lang.String"
returntype="java.util.List"
autocreate="true"
generate="false"/>
but if I am adding Java.util.List in my items.xml file then always its giving build error : list is not a valid type.
So please suggest me how I can create a map type attribute.
Thanks, Kesari Sapient corporation.
Request clarification before answering.
Kesari,
You need to define something like this
<collectiontypes>
<collectiontype code="MyListCode" elementtype="java.lang.String" autocreate="true" generate="true"
type="list"/>
</collectiontypes>
<maptype code="ParamTypeMap" argumenttype="java.lang.String"
returntype="MyListCode" generate="true" autocreate="true" />
</maptypes>
In the collection MyListCode you can define element type corresponding to the type you are going to store in the list collection.
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jena,
As per above map type definition, you are trying to create a map with String as key and value as a list object, as Hybris created its collection types you try creating a collection type with your required type and create the map type with the string and collection type, which will resolves the issue.
Regards,
Raghavendra.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.