ADF在运行时更新REST BC查询

时间:2019-12-28 18:33:10

标签: oracle-adf

我需要为从ADF VO对象生成的REST API发送参数。像本文一样,我朝着rowFinder的方向前进:http://andrejusb.blogspot.com/2017/01/sql-bind-variable-support-in-adf-bc-rest.html。但这导致了一个代码路径,在该路径中,我的某些自定义逻辑没有到达ViewObjectImpl.executeQuery()。 因此,我通过添加自定义属性(而不是映射到sql实体)来使其工作。 enter image description here

在运行时为:
DSS.VWS_QA_RFQ_LIST(TOKEN = 254602893029949)AND((((STATUS_FLAG =:vc_temp_1)AND(PARTIAL_FLAG =:vc_temp_2)和(RECEIVED_DAYS =:vc_temp_3)))按接收到的高位排序< Z_R_N>:Bind_RangePage_Low>````

我将RECEIVED_DAYS替换为RECEIVED> = trunc(sysdate)-这是我要运行的表达式。 这样做的代码:

        String query = this.getQuery();

        String updatedQuery = query.replace(AARQAConstants.LAST_DAYS_Q_NAME, AARQAConstants.TRUNC_RECEIVED_AND_CONDITION_WITHOUT_BIND);
        this.setQuery(updatedQuery);
        System.out.println("Generated Query: "+query);
        System.out.println("Updated Query: "+this.getQuery());
 } ```

 So, the **query** becomes one it is updated :
``` DSS.VWS_QA_RFQ_LIST WHERE (TOKEN=254602893029949) AND ( ( (STATUS_FLAG = :vc_temp_1 ) AND (PARTIAL_FLAG = :vc_temp_2 ) AND ((RECEIVED >= trunc(sysdate)-:) = :vc_temp_3 ) ) ) ORDER BY RECEIVED DESC) IQ  WHERE ROWNUM < :Bind_RangePage_High) WHERE Z_R_N > :Bind_RangePage_Low>  ```

The binding parameters seems to work based on ADF logs:
(STATUS_FLAG = :vc_temp_1 ) AND (PARTIAL_FLAG = :vc_temp_2 ) AND (RECEIVED >= trunc(sysdate)- :vc_temp_3 ) ) ) ORDER BY RECEIVED DESC) IQ  WHERE ROWNUM < :Bind_RangePage_High) WHERE Z_R_N > :Bind_RangePage_Low>
<oracle.adf.model> <ViewObjectImpl> <bindParametersForCollection> <[1989] Bind params for ViewObject: [com.aar.quoteacceleration.model.rfqs.views.RFQListVO]AARQAAppModule.RFQListVO>
<oracle.adf.model> <OracleSQLBuilderImpl> <bindParamValue> <[1990] Binding param "vc_temp_1": OPEN>
<oracle.adf.model> <OracleSQLBuilderImpl> <bindParamValue> <[1991] Binding param "vc_temp_2": N>
<oracle.adf.model> <OracleSQLBuilderImpl> <bindParamValue> <[1992] Binding param "vc_temp_3": 40>
<oracle.adf.model> <OracleSQLBuilderImpl> <bindRangePagingParams> <[1993] setting rownum query between (0, 29)>


But, the REST API does not bring back result set even though the same query pasted in sql developer has query results. The request path
StatusFlag=OPEN;PartialFlag=%27N%27;ReceivedDays=40&offset=0&orderBy=Received:desc

I confirmed on the Oracle DB the right query came in based on the sql text. Is there something I am missing in the way I am updating the VO Object's query at runtime? 

0 个答案:

没有答案