Hi,
I am getting the following error while using native sql query,
Quote:
org.hibernate.QueryException: No column name found for property [user] for alias [pi] [Select
pycis.INSTN_ID_N as {pi.instnIdN},
pycis.INSTN_NM_C as {pi.instnNmC},
pycis.CIBS_ACCT_NUM_N as {pi.cibsAcctNumN},
pycis.TMPL_TYPE_LVL_3_C as {pi.cibsStrucCodeC},
pycis.CIBS_DISC_NM_C as {pi.cibsDiscNmC},
pycis.CIBS_SUBDISC_NM_C as {pi.cibsSubdiscNmC},
smple.userr as {pi.user},
smple.datte as {pi.updDt}
from
pcr.v_pycis_dwh_acct pycis ,
(Select instAtt.INSTN_ID_N as instanceId,instAtt.UPD_USR_C as userr,instAtt.UPD_DT_D as
datte from pcr.T_RPT_INSTN_ATRB instAtt where instAtt.DOMAIN_NM_C = 'PCR_Instn_Attrib'
and instAtt.ATRB_CODE_C = 'ASMPL' and instAtt.DEL_IND_C is null) smple
where pycis.INSTN_ID_N = smple.instanceId (+)]
at org.hibernate.loader.custom.sql.SQLQueryParser.resolveProperties(SQLQueryParser.java:195)
at org.hibernate.loader.custom.sql.SQLQueryParser.substituteBrackets(SQLQueryParser.java:104)
at org.hibernate.loader.custom.sql.SQLQueryParser.process(SQLQueryParser.java:51)
My PCRPycisBean is given below,
Code:
public class PCRPycisBean implements java.io.Serializable{
private Long instnIdN;
private String instnNmC;
private String tmplTypeLvl1c;
private String tmplTypeLvl2c;
private String tmplTypeLvl3c;
private Long dwsAcctId;
private Long cibsAcctNumN;
private String qimdPortfNumC;
private String cibsDiscNmC;
private String cibsDiscCodeC;
private String cibsSubdiscCodeC;
private String cibsSubdiscNmC;
private String cibsStrucCodeC;
private String qimdStrucCodeC;
private String imBrandCodeC;
private String asapAcctNmC;
private Long asapAcctNumN;
private String user;
private Date updDt;
.... .. getters and setter
}
The query I am trying to execute is as follow's
Code:
<sql-query name="accSamplingQuery">
<return alias="pi" class="com.pyramis.pcrui.beans.PCRPycisBean" />
<![CDATA[
Select
pycis.INSTN_ID_N as {pi.instnIdN},
pycis.INSTN_NM_C as {pi.instnNmC},
pycis.CIBS_ACCT_NUM_N as {pi.cibsAcctNumN},
pycis.TMPL_TYPE_LVL_3_C as {pi.cibsStrucCodeC},
pycis.CIBS_DISC_NM_C as {pi.cibsDiscNmC},
pycis.CIBS_SUBDISC_NM_C as {pi.cibsSubdiscNmC},
smple.userr as {pi.user},
smple.datte as {pi.updDt}
from
pcr.v_pycis_dwh_acct pycis ,
(Select instAtt.INSTN_ID_N as instanceId,instAtt.UPD_USR_C as userr,instAtt.UPD_DT_D as
datte from pcr.T_RPT_INSTN_ATRB instAtt where instAtt.DOMAIN_NM_C = 'PCR_Instn_Attrib'
and instAtt.ATRB_CODE_C = 'ASMPL' and instAtt.DEL_IND_C is null) smple
where pycis.INSTN_ID_N = smple.instanceId (+)
]]>
</sql-query>
What can be the problem..
Thanks in advance,
Rohit