Hybris Commerce里的持久层
SAP的product都是DB provider无关的,application developer最多用Open SQL直接操作表。
Netweaver里支持的DB provider在这张表DBCON的DBMS字段里能看到:
Hybris里也有和CRM WebUI里的API layer起同样作用的layer - API layer, 封装了对DB的操作。
Hybris里类似SAP CRM这种持久层layer的实现是很多以DAO( Data Access Object)结尾的java class完成的,相当于上图SAP CRM Business layer层的function module:
随便点开一个DAO看其实现,里面也是拼SQL然后fire到DB去:
Hybris支持下列不同类型的数据库:
hybris开发我们一般使用HSQLDB: 一个轻量级的纯Java开发的开放源代码的关系数据库系统
我在Hybris Backoffice里搜索Product,返回两条记录
使用Flexible search在Hybris Administration Console里能得到同样的结果:
select * from {Product} where {code} = ‘cris03’
出于学习目的,我把这些字段依次整理罗列如下:
CREATEDTS: 这个产品创建的时间戳
MODIFIEDTS: 修改时间戳
TYPEPKSTRING: Hybris Product这个item type的唯一标识code,类型为字符串。
TypePKString represents the code of an item type. There is a unique code for each of the item types in your hybris system e.g. execute the flexible query, SELECT DISTINCT {item.itemType} FROM {Product as item} in hAC and it will give you the TypePKString of Product and all its child item types. You can validate the same by hovering the mouse over the rows representing Product or its child item types on Maintenance > Deployment page of hAC. I have also attached the screenshots for your quick reference.
Note: If you are interested to check the TypePKString of just Product, you should execute the flexible query, SELECT DISTINCT {item.itemType} FROM {Product! as item}.
因此,我搜索出来的两条记录的TYPEPKSTRING都相同,因为这两个来自staged和online catalog的实例,其类型都为Product.
这个值8796098297938,也可以在Hybris Administration comsole的Maintenance->Deployment菜单里查到:
PK:产品实例的主键。这个值在Backoffice product Administration标签页里能查到:
我们本地安装的用于开发目的的Hybris Commerce实例,默认的license只有30天有效期,过了之后需要用ant initialize重新build,以前的数据会丢掉,很不方便。
INFO [localhost-startStop-14] [Licence] This Hybris licence is only for demo or develop usage and is valid for 30 days.
INFO [localhost-startStop-14] [Licence] After this time you have to reinitialize database to continue your work.
INFO [localhost-startStop-14] [Licence] Remaining days ====> 24
本文介绍一种免费的申请开发license的方法,可以免去每隔30天重装Hybris的麻烦。
参考这个SAP support note:
https://launchpad.support.sap.com/#/notes/2137024
打开SAP License keys应用:
https://launchpad.support.sap.com/#/licensekey/wizard/installation/SAP-INTERN
点击Add New System按钮:
Product选择SAP Commerce:
Version就选择自己Hybris的实际版本号。
新建系统,作为开发用户,数据库选择成默认的hyper structured query language database:
最后点击Add License Key:
Hardware key:Y4989890650
点击Generate按钮:
成功生成license ke之后,点击download下载到本地,保存成一个txt文件:
这个txt文件打开长这样,中间是一段base64 encode之后的值:
使用命令行./license.sh -install CPS.txt进行安装:
license.sh -delete则可以删除license:
安装完毕后,到Hybris Administration console里能观察到这个license:
- 点赞
- 收藏
- 关注作者
评论(0)