简体   繁体   English

上可查询值和下可查询值

[英]Upper and/lower queriable values jdeveloper

I have a query form in a jspx file and i'm trying to define some of the values as case sensitive, meaning that i want to be able to find, for example, a name with all letters upper case and/or lower case and obtain the values that i would obtain if i've inserted the name correctly. 我在jspx文件中有一个查询表单,并且我试图将某些值定义为区分大小写,这意味着我希望能够找到例如所有字母均大写和/或小写的名称,以及获取如果我正确插入名称将获得的值。 Can someone indicate me where can i find something to accomplish that? 有人可以指出我在哪里可以找到实现目标的东西吗?

Thanks in advance 提前致谢

--------Update --------更新

Code from my jspx file 我的jspx文件中的代码

<af:query id="qryId1" headerText="Search" disclosed="true" 
          value="#bindings.ImplicitViewCriteriaQuery.queryDescriptor}"
          model="#bindings.ImplicitViewCriteriaQuery.queryModel}"
          queryListener="#bindings.ImplicitViewCriteriaQuery.processQuery}"
          queryOperationListener="#{bindings.ImplicitViewCriteriaQuery.processQueryOperation}"
          resultComponentId="::resId1"
          binding="#{backingBeanScope.backing_SearchCustomer.qryId1}"
          maxColumns="3" rows="2" fieldWidth="30%"
          displayMode="compact" saveResultsLayout="never"
          saveQueryMode="hidden" modeChangeVisible="false"/>

In a view criteria, for each criteria item there is a check box Ignore Case . 在查看条件中,对于每个条件项,都有一个复选框Ignore Case Uncheck it if you want to make that search field case sensitive. 如果要使该搜索字段区分大小写,请取消选中它。

If you are using All Queriable Attributes to create your search then you can set it in queryListner method of the query component. 如果使用“所有可查询属性”创建搜索,则可以在查询组件的queryListner方法中进行设置。 Here are the steps: 步骤如下:

Create a queryListener method for your query component 为您的查询组件创建一个queryListener方法

<af:query id="qryId1" headerText="Search" disclosed="true" value="#{bindings.ImplicitViewCriteriaQuery.queryDescriptor}" model="#{bindings.ImplicitViewCriteriaQuery.queryModel}" queryListener="#{backingBeanScope.searchBean.queryListener}" queryOperationListener="#{bindings.ImplicitViewCriteriaQuery.processQueryOperation}" resultComponentId="::resId1"/>

Make query attributes case insensitive in queryListener method 在queryListener方法中使查询属性不区分大小写

  public void queryListener(QueryEvent queryEvent)
  {
    QueryDescriptor qdesc = (QueryDescriptor) queryEvent.getDescriptor();
    ConjunctionCriterion conCrit = qdesc.getConjunctionCriterion();
    //access the list of search fields
    List<Criterion> criterionList = conCrit.getCriterionList();
    for (Criterion criterion: criterionList)
    {
      ((AttributeCriterion) criterion).setMatchCase(false);
    }
    invokeMethodExpression( "#{bindings.ImplicitViewCriteriaQuery.processQuery}", queryEvent);
  }

  private void invokeMethodExpression(String expr, QueryEvent queryEvent)
  {
    FacesContext fctx = FacesContext.getCurrentInstance();
    ELContext elContext = fctx.getELContext();
    ExpressionFactory eFactory =
      fctx.getApplication().getExpressionFactory();
    MethodExpression mexpr =
      eFactory.createMethodExpression(elContext, expr, Object.class,
                                      new Class[]
        { QueryEvent.class });
    mexpr.invoke(elContext, new Object[]
        { queryEvent });
  } 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM