Hybris DDIC type and its counterpart model class

简介:

在ABAP里,我们在SE11里面创建data type或者transparent table, 然后在ABAP代码里可以直接消费这些DDIC object.
而Hybris是基于Java的,大家知道在Java里除了primitive type如int, boolean这些一样,万物皆对象. 数据类型是一个Java Class,而这些数据类型具体的item(transaction data)就是Java Class的一个个实例:
every object stored in SAP Hybris Commerce is an instance of a type.

例子:
我在catalog这个extension里定义了一个data type catalog, 里面有个字段id:

那么用ant clean all build之后,会自动在这个folder下面生成对应的Model class, 遵循naming convention Model.java:

生成的Model class - 这种套路在ABAP里随处可见了,比如我们在SEGW里做Odata model,然后直接激活生成DPC MPC.

因为我在xml里指定了read=true, write=true, 因此会生成对应的getter和setter方法:


用法很简单,在Java code里拿到model instance,直接call setter / getter:

本文来自云栖社区合作伙伴“汪子熙”,了解相关信息可以关注微信公众号"汪子熙"。

相关文章
|
5月前
|
存储 供应链 搜索推荐
Spartacus product variant configuration sample data
Spartacus product variant configuration sample data
Unknown custom element: <add-employee> - did you register the component correctly? For red cursive c
原因: 1.组件名没写对(导入和注册不对应) 2.components少写了个s 3.组件命名最好是驼峰命名 4.导入时语法错误 5.代码中有两个components,后一个的值把前一个覆盖了 6.组件直接循环套用了
SAP WM 为Storage Type 004激活SUM报错 - Storage types without pick-point stor.type require partial pallet
SAP WM 为Storage Type 004激活SUM报错 - Storage types without pick-point stor.type require partial pallet
SAP WM 为Storage Type 004激活SUM报错 - Storage types without pick-point stor.type require partial pallet
SAP QM 执行事务代码QP01,系统报错 -Material type FOOD is not defined for task list type Q-
SAP QM 执行事务代码QP01,系统报错 -Material type FOOD is not defined for task list type Q-
SAP QM 执行事务代码QP01,系统报错 -Material type FOOD is not defined for task list type Q-
|
Java
Hybris DDIC type and its counterpart model class
Hybris DDIC type and its counterpart model class
127 0
Hybris DDIC type and its counterpart model class
|
JSON 数据格式
Fiori Elements objectPage component creation ui JSON model creation oModel.getMetaModel().load
Fiori Elements objectPage component creation ui JSON model creation oModel.getMetaModel().load
126 0
Fiori Elements objectPage component creation ui JSON model creation oModel.getMetaModel().load
Fiori Elements detail table data request logic
Fiori Elements detail table data request logic
118 0
Fiori Elements detail table data request logic
custom field further usage - add into UI and report
custom field further usage - add into UI and report
139 0
custom field further usage - add into UI and report
How to render S4 Code List extension field into CRM WebUI product search view
This question is asked by Wade. Suppose I have created one extension field in S4 with type CodeList which contains all possible queue type supported by JDK. This extension field must be exposed to CRM Product Search WebUI. POC is done in X3C/504:
How to render S4 Code List extension field into CRM WebUI product search view