meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
sap_hybris_commerce:sap_hybris_persistence_mechanism [2019/08/26 16:32] – [Localization of Hybris types and attributes] Antonio Robirosasap_hybris_commerce:sap_hybris_persistence_mechanism [2020/09/02 09:49] – deletion of products Antonio Robirosa
Line 91: Line 91:
     * The field can only be written once (initial=true)     * The field can only be written once (initial=true)
     * The field must be removed when the parent Item is removed (partof=true)     * The field must be removed when the parent Item is removed (partof=true)
 +
 +<WRAP center round important 100%>
 +Hybris don't trigger the remove interceptors when updating a partof relations. If a base product is updated with a **subset** of the variants which are on the database, **the missing variants will be removed** and you can't use a remove interceptor to prevent the deletion. This happens on SAP commerce 1905. \\
 +To really prevent the removal of products from the database you need a database trigger like the following one for Microsoft SQL Server:
 +<code>
 +return jaloSqlScriptService.runDeleteOrUpdateStatement("CREATE OR ALTER TRIGGER PRODUCTS_DEL ON products INSTEAD OF DELETE AS THROW 51000, 'Products must not be deleted', 1")
 +
 +</code>
 +This code create database trigger preventing any removal of products. It depends on [[https://github.com/arobirosa/areco-deployment-script-manager/wiki|Areco Deployment Script Manager]]
 +
 +</WRAP>
 +
     * The field is part of the secondary key and must be **unique** inside the cluster of servers (unique=true). A group of attributes could be unique. The validation is done by Hybris using Java code. As two threads may store two items with the same unique values on the database, you have to use database transactions to be sure that the fields are unique across the cluster of servers     * The field is part of the secondary key and must be **unique** inside the cluster of servers (unique=true). A group of attributes could be unique. The validation is done by Hybris using Java code. As two threads may store two items with the same unique values on the database, you have to use database transactions to be sure that the fields are unique across the cluster of servers
     * [[https://help.hybris.com/6.5.0/hcd/8bff7a568669101488a5e40cb7bbd0b9.html#itemsxmlelementreference-type_modifierstype|Other modifiers]]     * [[https://help.hybris.com/6.5.0/hcd/8bff7a568669101488a5e40cb7bbd0b9.html#itemsxmlelementreference-type_modifierstype|Other modifiers]]
Line 312: Line 324:
  
 ====== General Recommendations ====== ====== General Recommendations ======
 +  * Please read [[https://www.sap.com/cxworks/article/433893244/Data_Model_Design_with_the_SAP_Commerce_Cloud_Type_System|Hybris' general good practices on defining types.]] Those recommendations aren't on this page
 +  * Don't use the menu Backoffice > System > Types to modify the Hybris types on runtime because you changes will be lost after an update running system
  
-  * Please read [[https://wiki.hybris.com/display/hybrisALF/Type+System|Hybris' general good practices on defining types.]] Those recommendations aren't on this page +--Based on Hybris 6.5
- +
-  * Don't use the menu HMC > System > Types to modify the Hybris types on runtime because you changes will be lost after an update running system +
- +
-\\ Based on Hybris 6.+
- +
-<!-- +
-var jcomments=new JComments(64, 'com_content',%%'/%%component/jcomments%%/'%%); +
-jcomments.setList%%('%%comments-list'); +
-%%//%%--> +
- +
- +
-=== Add comment === +
- +
- Name (required) +
- +
- E-mail (required, but will not display) +
- +
- Website +
- +
-{{:components:com_jcomments:images:smilies::laugh.gif|:D}}{{:components:com_jcomments:images:smilies::lol.gif|:lol:}}{{:components:com_jcomments:images:smilies::smile.gif|:-)}}{{:components:com_jcomments:images:smilies::wink.gif|;-)}}{{:components:com_jcomments:images:smilies::cool.gif|8)}}{{:components:com_jcomments:images:smilies::normal.gif|:-|}}{{:components:com_jcomments:images:smilies::whistling.gif|:-*}}{{:components:com_jcomments:images:smilies::redface.gif|:oops:}}{{:components:com_jcomments:images:smilies::sad.gif|:sad:}}{{:components:com_jcomments:images:smilies::cry.gif|:cry:}}{{:components:com_jcomments:images:smilies::surprised.gif|:o}}{{:components:com_jcomments:images:smilies::confused.gif|:-?}}{{:components:com_jcomments:images:smilies::sick.gif|:-x}}{{:components:com_jcomments:images:smilies::shocked.gif|:eek:}}{{:components:com_jcomments:images:smilies::sleeping.gif|:zzz}}{{:components:com_jcomments:images:smilies::tongue.gif|:P}}{{:components:com_jcomments:images:smilies::rolleyes.gif|:roll:}}{{:components:com_jcomments:images:smilies::unsure.gif|:sigh:}}1000 symbols left +
- +
- Notify me of follow-up comments\\  +
- +
-[[#|Send]] +
- +
-[[#|Cancel]] +
- +
-  +
- +
-<!-- +
-function JCommentsInitializeForm() +
-+
-        var jcEditor = new JCommentsEditor%%('%%comments-form-comment', true); +
-        jcEditor.initSmiles%%('/%%components/com_jcomments/images/smilies%%/'%%); +
-        jcEditor.addSmile%%('%%:D','laugh.gif'); +
-        jcEditor.addSmile%%('%%:lol:','lol.gif'); +
-        jcEditor.addSmile%%('%%:-)','smile.gif'); +
-        jcEditor.addSmile%%('%%;-)','wink.gif'); +
-        jcEditor.addSmile%%('%%8)','cool.gif'); +
-        jcEditor.addSmile%%('%%:-|','normal.gif'); +
-        jcEditor.addSmile%%('%%:-%%*'%%,'whistling.gif'); +
-        jcEditor.addSmile%%('%%:oops:','redface.gif'); +
-        jcEditor.addSmile%%('%%:sad:','sad.gif'); +
-        jcEditor.addSmile%%('%%:cry:','cry.gif'); +
-        jcEditor.addSmile%%('%%:o','surprised.gif'); +
-        jcEditor.addSmile%%('%%:-?','confused.gif'); +
-        jcEditor.addSmile%%('%%:-x','sick.gif'); +
-        jcEditor.addSmile%%('%%:eek:','shocked.gif'); +
-        jcEditor.addSmile%%('%%:zzz','sleeping.gif'); +
-        jcEditor.addSmile%%('%%:P','tongue.gif'); +
-        jcEditor.addSmile%%('%%:roll:','rolleyes.gif'); +
-        jcEditor.addSmile%%('%%:sigh:','unsure.gif'); +
-        jcEditor.addCounter(1000, %%''%%, ' symbols left', 'counter'); +
-        jcomments.setForm(new JCommentsForm%%('%%comments-form', jcEditor)); +
-+
- +
-if (window.addEventListener) {window.addEventListener%%('%%load',JCommentsInitializeForm,false);+
-else if (document.addEventListener){document.addEventListener%%('%%load',JCommentsInitializeForm,false);+
-else if (window.attachEvent){window.attachEvent%%('%%onload',JCommentsInitializeForm);+
-else {if (typeof window.onload=='function'){var oldload=window.onload;window.onload=function(){oldload();JCommentsInitializeForm();}} else window.onload=JCommentsInitializeForm;}  +
-%%//%%--> +
- +
- +
-[[http://www.joomlatune.com|JComments]] +
- +
-  * You are here:   +
-  * [[:|Home]] {{:media:system:images:arrow.png}}  +
-  * Hybris' persistence mechanism+