[ 
https://issues.apache.org/jira/browse/OFBIZ-1988?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12637822#action_12637822
 ] 

Ray Barlow commented on OFBIZ-1988:
-----------------------------------

Nicolas,

There is an existing function findProductsById found in FacilityServices.java 
that seems to do nearly what you have submitted here? It doesn't extract the 
first result and isolate it but that sounds like a very bespoke requirement and 
the service would better suit reuse if it just returned a complete list.

Some general comments:
The code in the patch does not follow the standard formatting guidelines 
recommended for OFBiz
You've completely ignored error handling and are throwing general database 
exceptions back through the service call which is a problem.
You're using the view GoodIdentificationAndProduct so why not just return that 
rather than loop through and look up all the real "Product" entities? Chances 
are most callers would find the information they require on the 
GoodIdentificationAndProduct view entity and if required they can get the real 
Product entity. Might save a fair amount of database access for the majority of 
usage.

Ray

> Find product By this id or other identification
> -----------------------------------------------
>
>                 Key: OFBIZ-1988
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1988
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: nicolas malin
>             Fix For: SVN trunk
>
>         Attachments: findProductByGI.patch
>
>   Original Estimate: 0.17h
>  Remaining Estimate: 0.17h
>
> I create a service to find a product are all product that match a value given.
> If the service has just a productId, he search the product by the productId 
> and after on all goodIdentification.
> If a goodIdentificationType is present, the search is limit to this type

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to