Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0044043Openbravo ERPA. Platformpublic2020-05-12 13:552022-02-28 13:57
inigo_lerga 
Triage Omni OMS 
normalminorhave not tried
newopen 
5
 
 
dmiguelez
Core
No
0044043: Change in query from OBQuery to OBCriteria needed in ManageVariantsDS.java
In order to avoid non-constant HQLs and dynamic parts previously considered 'safe', it has been decided that a change from OBQuery to OBCriteria can separate the data from the code itself, solving the associated issues related to this matter.
-
-
No tags attached.
Issue History
2020-05-12 13:55inigo_lergaNew Issue
2020-05-12 13:55inigo_lergaAssigned To => inigo_lerga
2020-05-12 13:55inigo_lergaModules => Core
2020-05-12 13:55inigo_lergaTriggers an Emergency Pack => No
2020-05-12 13:56inigo_lergaStatusnew => scheduled
2020-05-13 10:00inigo_lergaNote Added: 0119800
2020-05-14 11:12inigo_lergaReview Assigned To => dmiguelez
2020-05-14 11:12inigo_lergaNote Added: 0119860
2020-05-14 11:12inigo_lergaStatusscheduled => closed
2020-05-14 11:12inigo_lergaResolutionopen => invalid
2020-05-14 15:07dmiguelezAssigned Toinigo_lerga => Triage Finance
2020-05-14 15:07dmiguelezNote Added: 0119883
2020-05-14 15:07dmiguelezStatusclosed => new
2020-05-14 15:07dmiguelezResolutioninvalid => open
2020-05-14 15:07dmiguelezTypedefect => design defect
2020-05-14 15:40dmiguelezNote Added: 0119884
2022-02-28 13:57vmromanosAssigned ToTriage Finance => Triage Omni OMS

Notes
(0119800)
inigo_lerga   
2020-05-13 10:00   
--Test Plan Mantis--
As the F&B International Group Admin role:
  - Go Product window and create a new record with any Search Key and
    name desired. Check the Is Generic checkbox.
    Press the Manage Variants button.

  #In this moment the modified code is executed, but not the query#

  - Go to Characteristic window and create a new record with name Color
    and marked as Variant.
    Go to Value Tab and create a new record with name Blue.
    Create another record with name Red.
    Save the record.

  - Again in the Product window, create a new record with any Search Key and
    name desired. Check the Is Generic checkbox.
    Go to Characteristics Tab and create a new record with the previously created
    Color Characteristic marked as Variant.
    Go to Characteristic Configuration SubTab and create one record for
    each Characteristic Value (Red and Bue).
    Save the record.
    Press the Manage Variants button.

  #In this moment the modified query is executed and two records are shown in
  the grid#
(0119860)
inigo_lerga   
2020-05-14 11:12   
--- This Issue is rejected ---
The hql contains subqueries that are not a good fit for this type of modification.

The only way to execute the query with OBCriteria would be to separate each subquery in its own OBCriteria.

This would cause performance Issues, as products usually have registered a considerable amount of characteristics and it would be needed to do one OBCriteria query for each one of them.
(0119883)
dmiguelez   
2020-05-14 15:07   
This issue can be fixed, but it needs an important refactor of the existing functionality to avoid the mentioned performance issues.

That is why it has been moved to design defect
(0119884)
dmiguelez   
2020-05-14 15:40   
The real problem is the "and exists ()" clauses added to the query.
As of now we do not know how, or if it is possible, to do it using a Criteria instead of an hql query.