Announcement

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

    DataSource fetchOperation query retrieval

    Dear Team,

    For a DataSource named "DEPARTMENT", I have 2 fetch operations having operationIds as "fetchDeptNames" and "fetchDeptAddresses"

    One of my requirement is user selects the criteria that is required for the fetch operation and then also he selects the operation Ids dynamically.

    We need to show the query which is formed ultimately after request has gone to DataSource and the DataSource internally is bound with a Server object as below
    Code:
    <serverObject className="erp.web.dmi.DepartmentDMI" />
    Is there a way to dynamically get the query which is formed and show it to the user.
    Please suggest me on this.

    We are working on the below environment:
    SmartClient version : Isomorphic SmartClient/SmartGWT Framework (10.0p_2014-12-23/PowerEdition Deployment 2014-12-23)

    Browser : IE9

    Thanks in advance.

    #2
    In what form do you want to show the query?

    You can use the server-side API SQLDataSource.getSQLClause() to get the raw SQL of the "where" clause.

    You can use the client-side API DataSource.getAdvancedCriteriaDescription() to get an English / natural language description of the query.

    You could use AdvancedCriteria.toJSON() to show a JSON encoding of the criteria.

    Comment


      #3
      We basically need the complete query - including
      select clause, table clause, where clause and order clause all together - so I finally need the final query thats being executed but dont want it to be really execute it.
      I just need to show it to the user.

      Comment


        #4
        Then you want SQLDataSource.getSQLClause() passing clauseType ALL.

        Comment

        Working...
        X