Openbravo Issue Tracking System - Retail Modules
View Issue Details
0047610Retail ModulesWeb POSpublic2021-08-31 14:542021-09-01 11:14
alostale 
alostale 
normaltrivialhave not tried
closedfixed 
5
 
RR21Q4 
No
0047610: Simplify HQLProperty API adding convenient factory methods
The Java API to extend masterdata models [1] is quite verbose:

    return Arrays.asList(
            new HQLProperty("product.weight", "weight"), 
            new HQLProperty("product.taxCategory.name", "taxcategoryname"));


It could be simplified using static factory methods similar to JDK's Map.ofEntries [2] and Map.entry [3]. To something like:

    import static org.openbravo.mobile.core.model.HQLProperty.property;
    ...

    return HQLProperty.listOfProperties(
            property("product.weight", "weight"), 
            property("product.taxCategory.name", "taxcategoryname"));



[1] http://wiki.openbravo.com/wiki/How_to_Extend_Models [^]
[2] https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html#ofEntries(java.util.Map.Entry...) [^]
[3] https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html#entry(K,V) [^]
-
No tags attached.
Issue History
2021-08-31 14:54alostaleNew Issue
2021-08-31 14:54alostaleAssigned To => Retail
2021-08-31 14:54alostaleTriggers an Emergency Pack => No
2021-09-01 08:03hgbotNote Added: 0131469
2021-09-01 11:14hgbotResolutionopen => fixed
2021-09-01 11:14hgbotStatusnew => closed
2021-09-01 11:14hgbotNote Added: 0131470
2021-09-01 11:14hgbotFixed in Version => RR21Q4
2021-09-01 11:14hgbotNote Added: 0131471
2021-09-01 11:14alostaleAssigned ToRetail => alostale

Notes
(0131469)
hgbot   
2021-09-01 08:03   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/280 [^]
(0131470)
hgbot   
2021-09-01 11:14   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/280 [^]
(0131471)
hgbot   
2021-09-01 11:14   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core [^]
Changeset: d66fff024b592ab6a4442ea216f5f05e1cd85251
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 2021-09-01T08:02:17+02:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/commit/d66fff024b592ab6a4442ea216f5f05e1cd85251 [^]

fixed FR-47610: simplify HQLProperty API adding convenient factory methods

Adds property(String hqlProperty, String jsonName) for the most common
constructor and listOfProperties(HQLProperty... properties) to be used
from ModelExtension.getHQLProperties.

---
M src/org/openbravo/mobile/core/model/HQLProperty.java
---