New method to filter one field from a list of GenericValues (to a List of Strings)
---------------------------------------------------------------------------------- Key: OFBIZ-4307 URL: https://issues.apache.org/jira/browse/OFBIZ-4307 Project: OFBiz Issue Type: Improvement Components: framework Affects Versions: SVN trunk Reporter: Mirko Vogelsmeier Priority: Minor Hi there, in the past i often got Lists of GenericValues that only contained a GenericValue with one field each, because the delegator already filtered the result. Like you want to filter "orderHeader" for a service to work with the orderId. In this case you got a list of GenericValues with only the field "orderId". But to work with the List you still always have to do .get to extract the one field. I added a method that is able to filter a List<GenericValue> to a List<String>. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
[ https://issues.apache.org/jira/browse/OFBIZ-4307?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mirko Vogelsmeier updated OFBIZ-4307: ------------------------------------- Attachment: EntityUtil.java.patch If you like this patch here are some other thoughts: How do you like a more generic Method that does not require a "fieldName" but just a GenericValue with one field? > New method to filter one field from a list of GenericValues (to a List of Strings) > ---------------------------------------------------------------------------------- > > Key: OFBIZ-4307 > URL: https://issues.apache.org/jira/browse/OFBIZ-4307 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Mirko Vogelsmeier > Priority: Minor > Attachments: EntityUtil.java.patch > > > Hi there, > in the past i often got Lists of GenericValues that only contained a GenericValue with one field each, because the delegator already filtered the result. > Like you want to filter "orderHeader" for a service to work with the orderId. In this case you got a list of GenericValues with only the field "orderId". But to work with the List you still always have to do .get to extract the one field. > I added a method that is able to filter a List<GenericValue> to a List<String>. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4307?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Scott Gray closed OFBIZ-4307. ----------------------------- Resolution: Not A Problem Hi Mirko, thanks for your contribution but I'm afraid there is already a method in EntityUtil that performs the same function. see getFieldListFromEntityList(...). > New method to filter one field from a list of GenericValues (to a List of Strings) > ---------------------------------------------------------------------------------- > > Key: OFBIZ-4307 > URL: https://issues.apache.org/jira/browse/OFBIZ-4307 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Mirko Vogelsmeier > Priority: Minor > Attachments: EntityUtil.java.patch > > > Hi there, > in the past i often got Lists of GenericValues that only contained a GenericValue with one field each, because the delegator already filtered the result. > Like you want to filter "orderHeader" for a service to work with the orderId. In this case you got a list of GenericValues with only the field "orderId". But to work with the List you still always have to do .get to extract the one field. > I added a method that is able to filter a List<GenericValue> to a List<String>. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
Free forum by Nabble | Edit this page |