Sql 在公式属性上使用投影
我的XML映射文件中有一个属性,如Sql 在公式属性上使用投影,sql,oracle,properties,formula,projection,Sql,Oracle,Properties,Formula,Projection,我的XML映射文件中有一个属性,如 <property name="CreatedByLogin" formula="(select x.fst_name || ' ' || x.last_name from sebl_dev.S_CONTACT x where x.ROW_ID=CREATED_BY)" type="String" /> 我确实得到了Oracle例外 有没有办法对使用公式声明的属性进行投影 我生成的SQL是 select * from ( S
<property name="CreatedByLogin" formula="(select x.fst_name || ' ' || x.last_name from sebl_dev.S_CONTACT x where x.ROW_ID=CREATED_BY)" type="String" />
我确实得到了Oracle例外
有没有办法对使用公式声明的属性进行投影
我生成的SQL是
select
*
from (
SELECT
this_.ROW_ID as y0_,
this_.CREATED as y1_,
this_.CREATED_BY as y2_,
this_.STATUS as y3_,
this_.PSR_NUM as y4_,
this_.ORDER_ID as y5_,
this_.WFM_ID as y6_,
this_.VIRTUAL_SS_ID as y7_,
this_.VERIFIED_WITH as y8_,
this_.REQ_DUE_DATE as y9_,
this_.TYPE as y10_,
account1_.NAME as y11_,
account1_.OU_NUM as y12_,
this_.DESCRIPTION as y13_,
account1_.MARKET_TYPE_CD as y14_,
account1_.X_SALES_CHANNEL as y15_,
this_.QUOTE_ID as y16_,
(
select
x.fst_name || ' ' || x.last_name
from sebl_dev.S_CONTACT x
where x.ROW_ID=this_.CREATED_BY)
as y17_,
(
select
x.fst_name || ' ' || x.last_name
from sebl_dev.S_CONTACT x
where x.ROW_ID=this_.LAST_UPD_BY)
as y18_,
serviceacc2_.INTEGRATION_ID as y19_,
serviceacc2_.NAME as y20_,
accountadd3_.ADDR as y21_,
accountadd3_.ADDR_LINE_2 as y22_,
accountadd3_.CITY as y23_,
accountadd3_.STATE as y24_,
accountadd3_.ZIPCODE as y25_
FROM XOOE.XO_SS_HEADER this_
inner join XOOE.XO_SS_DETAILS this_1_
on this_.ROW_ID=this_1_.ROW_ID
inner join sebl_dev.S_ORG_EXT account1_
on this_.CUST_ACCNT_ID=account1_.ROW_ID
left outer join sebl_dev.S_org_ext_x account1_1_
on account1_.ROW_ID=account1_1_.Row_id
left outer join sebl_dev.S_ORG_EXT_UTX account1_2_
on account1_.ROW_ID=account1_2_.PAR_ROW_ID
inner join sebl_dev.S_ORG_EXT serviceacc2_ on this_.SERV_ACCNT_ID=serviceacc2_.ROW_ID
left outer join sebl_dev.S_org_ext_x serviceacc2_1_
on serviceacc2_.ROW_ID=serviceacc2_1_.Row_id
left outer join sebl_dev.S_ORG_EXT_UTX serviceacc2_2_
on serviceacc2_.ROW_ID=serviceacc2_2_.PAR_ROW_ID
inner join sebl_dev.S_ADDR_PER accountadd3_
on serviceacc2_.PR_ADDR_ID=accountadd3_.ROW_ID
WHERE this_.TYPE = :p0 )
where rownum <= :p1
我最好的猜测是:
您正在从没有定义键的表中选择键。您必须找出它是哪一个表,并向其中添加主键字段。这是Oracle 9、10和11的早期版本中的一个已知错误。它显然是固定在最新版本 问题是由这些旧版本处理SQL-92样式联接的方式中的错误引起的。所以,如果无法升级,您可以通过使用旧式SQL-89联接来解决这些问题。例如,内部联接:
SELECT column
FROM table1 t1, table2 t2
WHERE t1.pk = t2.fk
另一个示例,这次是左连接:
SELECT column
FROM table1 t1, table2 t2
WHERE t1.pk = t2.fk(+)
更多信息:
SELECT column
FROM table1 t1, table2 t2
WHERE t1.pk = t2.fk
SELECT column
FROM table1 t1, table2 t2
WHERE t1.pk = t2.fk(+)