1 2 Previous Next 15 Replies Latest reply on Nov 16, 2012 8:32 PM by OAF_Monkey Go to original post
      • 15. Re: Another dynamic where clause question
        ok...finally was able to figure it out. My assumption was when the "executeQuery()" is called, it would run the sql statement that is present in the VO of page2 (also assumed that the where clause would be appended to the sql statement with the "setWhereClause("PRIMARYKEY = :1");").

        For what ever reason, that does not seems to happen. Hence had to explicitly call the setQuery() with the same sql statement in the VO of page2.

        Final code looks like:
                    setQuery("SELECT * FROM <my table> where PRIMARYKEY = :1 ");
                    //setWhereClause("PRIMARYKEY = :1");            
                    setWhereClauseParams(null); // Always reset
                    setWhereClauseParam(0, primarykeyval);
                    System.out.println("Query Executed 1" + getQuery());
        Page2 is now rendering and shows me what I need.

        Thank you for all for taking time to try and solve my issue.

        1 2 Previous Next