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

Is it possible to create an attribute of type Relation :- CategoryProductRelation ?

bidyadhar_tripathy
Participant
0 Likes
710

Hi Experts,

We have a requirement, where we need to create an attribute of type : CategoryProductRelation in our custom product type.

                 <attribute qualifier="primaryCategory" type="CategoryProductRelation">
                     <persistence type="property"/>
                 </attribute>

We are able to insert and show the attribute value in backoffice, but attribute is not getting created in {custom-product}*Model.java class thats why we are not able to access the attribute in code level.

Any pointers in this issue. Whether we can use attribute of type Relation or not ?

Note : Hybris version 6.7

Accepted Solutions (1)

Accepted Solutions (1)

arvind-kumar_avinash
Active Contributor
0 Likes

I think your use case is to mark a category as main/default/primary for a product. If this is the case, you can achieve it by creating an attribute like attribute qualifier="primaryCategory" type="Category" in your-product itemtype. Any reason why you want to create it of type, CategoryProductRelation?

arvind-kumar_avinash
Active Contributor
0 Likes

Hi - how did you solve your problem? Did you use attribute qualifier="primaryCategory" type="CategoryProductRelation" or attribute qualifier="primaryCategory" type="Category"?

bidyadhar_tripathy
Participant
0 Likes

Hi Arvind,

We used attribute qualifier="primaryCategory" type="Category".

Thank you for your answer.

arvind-kumar_avinash
Active Contributor
0 Likes

You are most welcome.

Answers (0)