我有一个 oracle.toplink.expressions.Expression 表达式对象,它是使用 oracle.toplink.expressions.ExpressionBuilder 创建的。我想找到它的等效 SQL 查询(比如从员工 emp 中选择 emp.empname,emp.empId),它最终将被触发以获取数据。我想找到它的等价 Statement/PreparedStatement 或任何可以帮助我获得即将被触发的原始 SQL 语句的东西。
例如,以下是 toplink 表达式:
expressionBuilder.get("empName").equal("Eric");
我想获得等效的 SQL 查询:
select emp.empName,emp.emp_id,emp.sal from employee emp where emp.empName like 'Eric'
请让我知道是否有任何 API 可以获取溶胶。我尝试了 DatabaseQuery 的实现类,但找不到任何可以实现这一点的方法。
下面是我的 toplink 表达式:
Logical operator AND
Logical operator AND
Logical operator AND
Logical operator AND
Logical operator AND
Logical operator AND
Logical operator AND
Logical operator AND
Relation operator <
Query Key minEffectiveBegDate
Base com.altra.common.data.OperationalTrxData
Constant Tue Feb 01 08:00:00 CST 2011
Relation operator >
Query Key maxEffectiveEndDate
Base com.altra.common.data.OperationalTrxData
Constant Sat Jan 01 08:00:00 CST 2011
Relation operator <
Query Key begDate
Query Key calculatedQuantityDataList
Query Key qtyClassificationDataList
Query Key operationalQuantityDataList
Base com.altra.common.data.OperationalTrxData
Constant Tue Feb 01 08:00:00 CST 2011
Relation operator >
Query Key endDate
Query Key calculatedQuantityDataList
Query Key qtyClassificationDataList
Query Key operationalQuantityDataList
Base com.altra.common.data.OperationalTrxData
Constant Sat Jan 01 08:00:00 CST 2011
Relation operator =
Query Key opsTrxClassification
Base com.altra.common.data.OperationalTrxData
Constant -5001579
Relation operator =
Query Key accountingCompany
Base com.altra.common.data.OperationalTrxData
Constant 1196
Logical operator OR
Logical operator AND
Relation operator =
Query Key sourceRelatedNodeObjType
Base com.altra.common.data.OperationalTrxData
Constant -2094
Relation operator IN
Query Key sourceRelatedNodeObjId
Base com.altra.common.data.OperationalTrxData
Constant [4187]
Logical operator AND
Relation operator =
Query Key dispositionRelatedNodeObjType
Base com.altra.common.data.OperationalTrxData
Constant -2094
Relation operator IN
Query Key dispositionRelatedNodeObjId
Base com.altra.common.data.OperationalTrxData
Constant [4187]
Relation operator =
Query Key qtyType
Query Key operationalQuantityDataList
Base com.altra.common.data.OperationalTrxData
Constant -5000328
Relation operator =
Query Key qtyStatus
Query Key qtyClassificationDataList
Query Key operationalQuantityDataList
Base com.altra.common.data.OperationalTrxData
Constant -5000316
我想要 SQL 等价物
select otd.operationaltrx_id,otd.accountingCompany from OperationalTrxData otd where minEffectiveBegDate > to_date('','') ...
谢谢,阿迪西亚。