Entity Find Entity Condition Case sensitive

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Entity Find Entity Condition Case sensitive

Robert Gan
Hey guys,

I just have a short question:
How can I make an entiy find request which is not case sensitive.

My current request (not case sensitive is like):
condList.add(EntityCondition.makeCondition("supplierProductId", EntityOperator.LIKE, "%"+testCondition+"%");    
...
...
EntityCondition condition = EntityCondition.makeCondition(condList, EntityOperator.AND);
List<GenericValue> test = delegator.findList("SupplierProduct", condition, UtilMisc.toSet("productId"), null, null, false);

how can I include the case sensitive option?
Reply | Threaded
Open this post in threaded view
|

Re: Entity Find Entity Condition Case sensitive

Mandeep Sidhu
This should do the trick;

EntityCondition.makeCondition(EntityFunction.UPPER_FIELD("supplierProductId"),
EntityOperator.LIKE, EntityFunction.UPPER(((String)
testCondition).toUpperCase())

Regards,
Mandeep Sidhu
www.simbacart.com
( Ofbiz based )



On Mon, Mar 17, 2014 at 7:25 AM, Robert Gan <[hidden email]> wrote:

> Hey guys,
>
> I just have a short question:
> How can I make an entiy find request which is not case sensitive.
>
> My current request (not case sensitive is like):
> condList.add(EntityCondition.makeCondition("supplierProductId",
> EntityOperator.LIKE, "%"+testCondition+"%");
> ...
> ...
> EntityCondition condition = EntityCondition.makeCondition(condList,
> EntityOperator.AND);
> List<GenericValue> test = delegator.findList("SupplierProduct", condition,
> UtilMisc.toSet("productId"), null, null, false);
>
> how can I include the case sensitive option?
>
>
>
> --
> View this message in context:
> http://ofbiz.135035.n4.nabble.com/Entity-Find-Entity-Condition-Case-sensitive-tp4649374.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Entity Find Entity Condition Case sensitive

Robert Gan
cool thanks :)