Thanks Harmeet & David for your comments. I will get back to you guys if I need more info.
-- Ashish On Sun, Jun 21, 2009 at 2:01 AM, Harmeet Bedi <[email protected]>wrote: > From: "Ashish Vijaywargiya" <[email protected]> > > Anyone having experience with MySql or Postgres in this area? > > > Ashish, I had to address this with postgres. > > Did this in EntityOperator. > > public static final EntityComparisonOperator LIKE = new > EntityComparisonOperator(ID_LIKE, "LIKE") { > public boolean compare(Comparable lhs, Object rhs) { return > EntityComparisonOperator.compareLike(lhs, rhs); } > protected void makeRHSWhereString(ModelEntity entity, > List<EntityConditionParam> entityConditionParams, StringBuilder sb, > ModelField field, Object rhs, DatasourceInfo datasourceInfo) { > // HBNOTE: fix for postgres compatibility. will break other > databases. Should conditionalize > sb.append(' ').append("ILIKE").append(' '); > makeRHSWhereStringValue(entity, entityConditionParams, sb, > field, rhs, datasourceInfo); > } > }; > > > basically EntityOperator is where operations like join, like etc are mapped > from ofbiz entity syntax to db syntax. Needed to interpret all 'like' clause > operations to postgres 'ilike' (case insesitive like), so mapped it. > > It would be nice if ofbiz had a db.properties where one could switch > interpretation. Some dbs like SQL server are insensitive while others like > postgres are case sensitive. Search from end user perspective is typically > always case insensitive, so the need to change mapping to 'ilike' > equivalent. > > Harmeet > > > > ----- Original Message ----- > From: "Ashish Vijaywargiya" <[email protected]> > To: "OFBiz User ML" <[email protected]> > Sent: Saturday, June 20, 2009 11:25:35 AM GMT -05:00 US/Canada Eastern > Subject: Case Insensitive search on Primary key > > Do we have some settings in OFBiz so that we could perform case > insensitive search on primary key? > > To elaborate more on this: > > Suppose I have a product GZ_2644. > Our target is that user should be navigated to EditProduct page > (https://localhost:8443/catalog/control/EditProduct) if user provides > any of the Product_Id shown below: > GZ_2644 or gz_2644 or Gz_2644 or gZ_2644. And then on saving it will > take GZ_2644 as the product_id and will save the values if anything is > updated on EditProduct page. > > And suppose if I am adding GZ_2644 in the OrderView screen as the new > line item by typing gz_2644 then it should not give any error & will add > product with id GZ_2644 in the Order. > > AFAIK these are database specific settings but I am not able to figure > solve this issue. > Anyone having experience with MySql or Postgres in this area? > > Any help on this would be greatly appreciated. > Thanks ! > > -- > Ashish > >
