cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Custom attribute able to save, but unable to retrieve via facade.

Former Member
0 Likes
917

Hi there,

I have added a new attribute for customerreview in the below item bean

customerreview-items.xml

 <attribute qualifier="customcomment" type="java.lang.String">
     <description>
         Custom Comment
     </description>
     <persistence type="property">
         <columntype database="oracle">
             <value>CLOB</value>
         </columntype>
         <columntype database="sap">
             <value>NCLOB</value>
         </columntype>
         <columntype>
             <value>HYBRIS.LONG_STRING</value>
         </columntype>
     </persistence>
 </attribute>

And i have configured the reviewdata in commercefacade to handle the new property

commercefacades-bean.xml

 <bean class="de.hybris.platform.commercefacades.product.data.ReviewData">
         <property name="id" type="String"/>
         <property name="headline" type="String"/>
         <property name="comment" type="String"/>
         <property name="rating" type="Double"/>
         <property name="date" type="java.util.Date"/>
         <property name="alias" type="String"/>
         <property name="customcomment" type="String"/>
         <property name="principal"
 type="de.hybris.platform.commercefacades.user.data.PrincipalData"/>
 </bean>

After perfort clean all, and system update i am able to see my new attribute in the table via flexible search, and i am also able to save the data. Unfortunately when i try retrieving the data via the same facade service, no data is being passed for that attribute.

After a debug session i find that the getCustomcomment() method isn't being invoked like the other attribute getters in the CustomerReviewModel.

Am I supposed to manually write a logic to get the custom attributes?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

You need to update or create a populator. In this populator you have to map Model to the Data object. Populaters are injected into converters.

https://help.hybris.com/1811/hcd/8b937ff886691014815fcd31ff1de47a.html

Answers (1)

Answers (1)

Former Member
0 Likes

Hi Jeroen,

Thanks! I understand now.