
- SAP Hybris Tutorial
- SAP Hybris - Home
- SAP Hybris - Introduction
- SAP Hybris - Product Family
- SAP Hybris VS SAP C4C
- Tools Provided by Hybris
- SAP Hybris - Accelerators Concept
- Content Management Overview
- SAP Hybris - Modelling
- SAP Hybris - Bundling
- Workflow & Business Process Engine
- SAP Hybris - Catalog Management
- SAP Hybris - Media Management
- Web Content Management
- Commerce Management Overview
- SAP Hybris - Search Option
- SAP Hybris - Personalization
- SAP Hybris - Payment Options
- SAP Hybris - Promotions
- SAP Hybris - Subscriptions
- Order Management Overview
- Customer Service Module
- Assisted Services Module
- SAP Hybris - Marketing
- SAP Hybris - Billing
- SAP Hybris - Cloud for Customer
- SAP Hybris - Product for Sales
- SAP Hybris - Product for Service
- Integration with On-premise SAP Solution
- C4C Project Implementation
- Cloud Applications Studio
- Security and User Management
- SAP Hybris - Interview Questions
- SAP Hybris Useful Resources
- SAP Hybris - Quick Guide
- SAP Hybris - Useful Resources
- SAP Hybris - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
SAP Hybris - Modelling
One of the main features in Hybris is the flexibility to add new objects to the global Hybris Commerce Data model. Hybris data modeling helps an organization in maintaining their database and help to manage database connections and queries. Hybris Type system is used to design data modeling in Hybris.
A Hybris type system has the following types supported for data modeling −
Items.xml − This file is used for data modeling in a Hybris Commerce data model.
Item types − This is used to create tables.
Relation types − This is used to create relation between tables.
Atomic types − Used to create various Atomic types.
Collection types − Used to create Collections.
Map Types − To define maps.
Enum types − To define Enums.
Let us now discuss all of these in detail.
Atomic Types
These are defined as basic types in Hybris, which include Java number and string objects – java.lang.integer, java.lang.boolean or java.lang.string.
<atomictypes> <atomictype class = "java.lang.Object" autocreate = "true" generate = "false" /> <atomictype class = "java.lang.Boolean" extends = "java.lang.Object" autocreate = "true" generate = "false" /> <atomictype class = "java.lang.Double" extends = "java.lang.Number" autocreate = "true" generate = "false" /> <atomictype class = "java.lang.String" extends = "java.lang.Object" autocreate = "true" generate = "false" /> </atomictypes>
Item Types
Item types are used to create new tables or to update existing tables. This is considered as a base for a Hybris type system. All new table structures are configured over this type using different attributes as shown below −
<itemtype code = "Customer" extends = "User" jaloclass = "de.hybris/platform.jalo.user.Customer" autocreate = "true" generate = "true"> <attributes> <attribute autocreate = "true" qualifier = "customerID" type = "java.lang.String"> <modifiers read = "true" write = "true" search = "true" optional = "true"/> <persistence type = "property"/> </attribute> </attributes> </itemtype>
Relation Types
This type is used to create a link between tables. For example – You can link a country and region.
<relation code = "Country2RegionRelation" generate = "true" localized = "false" autocreate = "true"> <sourceElement type = "Country" qualifier = "country" cardinality = "one"> <modifiers read = "true" write = "true" search = "true" optional = "false" unique = "true"/> </sourceElement> <targetElement type = "Region" qualifier = "regions" cardinality = "many"> <modifiers read = "true" write = "true" search = "true" partof = "true"/> </targetElement> </relation>
Enum Types
These are used to build enumeration in Java for preparing a particular set of values. For example – Months in a year.
<enumtype code = "CreditCardType" autocreate = "true" generate = "true"> <value code = "amex"/> <value code = "visa"/> <value code = "master"/> <value code = "diners"/> </enumtype>
Collection Types
These are used to build collection/group of element types – group of products, etc.
<collectiontype code = "ProductCollection" elementtype = "Product" autocreate = "true" generate = "true"/> <collectiontype code = "LanguageList" elementtype = "Langauage" autocreate = "true" generate = "true"/> <collectiontype code = "LanguageSet" elementtype = "Langauage" autocreate = "true" generate = "true"/>
Map Types
Map types are used to store key values pairs in Hybris data modeling. Each key represents its own code.
<maptype code = "localized:java.lang.String" argumenttype = "Language" returntype = "java.lang.String" autocreate = "true" generate = "false"/>