Sunday, 28 January 2018

Oracle ADF Case Insensitive Search

Oracle ADF Case Insensitive Search

   public String getViewCriteriaClause(boolean forQuery) {
    if (forQuery == false){
         // clause is for cache (in-memory) 
      // WARNING - It is possible to set the criteria mode to cache and the query mode
  // to database.  That will query for a larger result set, then immediately filter it down in-memory
  // queryModeDoesNotUseCache will be true in that case even though it performs a
  // in-memory filter after the fact.  Doing so is not recommended as it wastes memory unless you
              boolean queryModeDoesNotUseCache =
                ((getQueryMode() & ~QUERY_MODE_SCAN_DATABASE_TABLES) == 0);
            ViewCriteria[] vcs =
                getApplyViewCriterias(ViewCriteria.CRITERIA_MODE_CACHE);
            if (vcs != null && vcs.length > 0) {
                boolean criteriaForCacheModeOnlyFound = false; //
                for (ViewCriteria vc : vcs) {
                    criteriaForCacheModeOnlyFound |=
                            (vc.getCriteriaMode() == ViewCriteria.CRITERIA_MODE_CACHE);
                    if (vc.isUpperColumns() == false) {
                        vc.setUpperColumns(true);
                                 // puts UPPER(..) around the values for filtering in-memory
                    }
                }
                if (queryModeDoesNotUseCache &&
                    !criteriaForCacheModeOnlyFound) {
                    // if query mode does not apply to cache and criteria mode
                    // is not "cache only" mode (i.e not for both cache & database)
                    // don't apply any in-memory filter.
                    // This is needed in PS2 to prevent in-memory filtering of dates which causes
                    // no results because the time component is compared as well.
                    // see CustomSQLBuilderImpl which has a PS2 workaround to trunc the date
                    // so the date filters work (without comparing time component)
                    // trunc will fail if applied to a in-memory filter on PS2
                    return null;
                }
            }
    } else{
            ViewCriteria[] vcs =
          getApplyViewCriterias(ViewCriteria.CRITERIA_MODE_QUERY);
      if (vcs != null && vcs.length > 0) {
          for (ViewCriteria vc : vcs) {
              if (vc.isUpperColumns()) {
                  vc.setUpperColumns(false); // remove UPPER(..) around the values for database queryies
              }
          }         
      }
    }
        String clause = super.getViewCriteriaClause(forQuery);
        return clause;
    }
Posted by Don Kleppinger at 11:45 AM


Tuesday, 23 January 2018

Git Commands

Git Commands

git log --oneline
git branch
git branch feature
git branch
git checkout feature
git branch
git checkout -b <new Branch>
git checkout -b extra
git branch
git status

git add .
git commit -m "new login signup files"
git log -oneline
git diff master..feature

git checkout master
git merge feature

To Delete Branch
git branch -d feature
git branch -D feature (Force Delete)


To display contents:
git log --oneline
git show <code>

Change latest commit Name
git commit -amend -m "<<commit messge>>" f1

git commit -am "f2 deleted"

rm f1
git status
git checkout f1  [recover deleted]

git rm filename  [it will be deleted permanetly]
git status
git commit -m "f1 deleted"

git log --oneline

mv f3 f5
git status
git add .
git commit -am "f3 to f5"

git mv f5 f3
git status

git commit -m "f5 rename as f3"
git log --oneline