0

kinda new to the hybris environment and still learning. Hoping to ask I have a list of values being extracted from hyrbis.. basically I have an order type that contains order number, name of customer, and other order related values, but under it there's an address model/type that is a (sub?) type or a whole different model/itemtype that is nested inside/linked to order (basically a sub-type.. that has street name, district, zip code, etc.). The java code uses a type called AttributeDescriptorModel that retrieves the particular order details. I'm not very good at manipulating the AttributeDescriptorModel variable, there are a lot of methods in it like getName(), getAttributeType(), getQualifier(), and other methods.. I was thinking of intercepting assigning to the list from the attributedescriptor where it stores it's values (the list is the one used by the java class for it's display purposes). When it gets to the address model type I was hoping to store the address model to a temporary addressModel type variable and then extract it's address details into individual variables, basically just get the addressmodel values. Thank you in advance for any help. Sorry for the newbie question.

buencamino
  • 91
  • 1
  • 10
  • If you are a beginner, I suggest you start with [this](https://learning.sap.com/learning-journey/explore-the-technical-essentials-of-sap-commerce-cloud) or [this](https://help.sap.com/docs/SAP_COMMERCE/3fb5dcdfe37f40edbac7098ed40442c0/a1ef894ac89545e79c470c726b487d13.html?locale=en-US). – Arvind Kumar Avinash Aug 21 '23 at 10:12

1 Answers1

0

If all you need to do is extract order details then there should be no need to deal with Attribute Descriptor -> that is part of the type system metadata.

The build of Hybris also code generates model classes for each type, with the various attributes generated as getters/setters. Typically to extract an Order you would deal with an OrderModel, call the getters on the OrderModel instance to get the relevant values. That includes addresses as OrderModel has getDeliveryAddress(),getPaymentAddress() methods that return an AddressModel instance ... which has getters to access the various fields on the address.