Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    #16
    If a parameter affects the results, it should be included in the criteria.

    If it should not be used by the SQLDataSource in the generated SQL, you can set customSQL="true" on the field in the .ds.xml.

    Comment


      #17
      The scenario is that second request parameter also needs to go to the dsresponse, untouched.

      param_1 - used for criteria

      param_2 - no criteria, nothing. I just need to send it to ds.xml and take it from there and append to dsresponse in my DMI.

      I need both parameters.

      Also, for these parameters to go to ds.xml, do I need to set these parameters to dsrequest, before doing

      dsrequest.execute();

      Thanks.

      Comment


        #18
        Yes. This does not change anything - see previous response.

        Comment


          #19
          Ok, after reading about SQL Templating. I understood that, the field should be added only if the corresponding column exists in the database table. Please pardon me if I understood wrong.

          The Parameters that I am passing, one of them is in Database table, and other one is not there.

          The requirement is that even though that param_2 is not available in the table. I need to populate in DSResponse.

          Thanks.

          Comment


            #20
            You understood wrong - please read the complete documentation for SQL Templating - at *least* the QuickStart Guide stuff - don't skim and don't skip. You need to read about the customSQL setting and related settings.

            Comment


              #21
              ok I have read the entire java doc and did this.

              In my logic

              dsRequest = new DSRequest("fetch", "fetch");
              //variable
              dsRequest.addToTemplateContext("param_2", param_2);
              //column in table
              dsRequest.setAttribute("param_1", param_1);
              dsRequest.setOperationId("fetch");
              dsResponse = dsRequest.execute();

              In my ds.xml

              <binding .....
              methodArguments="$criteria.param_1,$dsRequest.param_2" >

              Now in my DMI. I did this.

              criterion = Restrictions.like("param_1", param_1, MatchMode.ANYWHERE);

              Now How can I retrieve the param_2 in DMI.

              Thanks.

              Comment

              Working...
              X