Ways to set the Query Mode programatically


The following snippet will be helpful in setting up the mode of the query criteria in programmatic way.

public Boolean setAdvancedMode(){
              QueryDescriptor descriptor =
                      (QueryDescriptor)evaluateEL
                  ("#{bindings.SearchCriteriaQuery.queryDescriptor}");
              descriptor.changeMode(QueryDescriptor.QueryMode.ADVANCED);
             return true;
}

public Object evaluateEL(String el) {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        ELContext elContext = facesContext.getELContext();
        ExpressionFactory expressionFactory =
            facesContext.getApplication().getExpressionFactory();
        ValueExpression exp =
            expressionFactory.createValueExpression(elContext, el,
                                                    Object.class);
       return exp.getValue(elContext);
    }

Advertisements

One thought on “Ways to set the Query Mode programatically

  1. Yeni

    Hi,As announced drniug his session on Open World – security permission declaration is moved from Page Definition files to one central file. Same file where security permissions are defined for ADF Task Flows. Also, there are a couple of new WebLogic configuration related files. But in general, security model remains the same. Good thing – more wizards for declarative development are added.Regards,Andrejus

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s