Hibernate version:
- Hibernate 2.1.2
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
************* initialize the sessionFactory *********** net.sf.hibernate.impl.SessionFactoryImpl@385f6c3a
Hibernate: select ttkwqworkq0_.QUE_ID as x0_0_, ttkwqworkq0_.QUE_DESC_X as x1_0_, ttkwqworkq0_.NODE_ID as x2_0_, ttkwqworkq0_.FID_CO_NM as x3_0_, ttkwqworkq0_.SYS_ADM_GRP_C as x4_0_, ttkwqworkq0_.USE_NODE_TRNF_RULE_I as x5_0_, ttkwqworkq0_.DEL_I as x6_0_, ttkwqworkq0_.MOD_DEST_I as x7_0_, ttkememail1_.EMAIL_ADDR as x8_0_, ttkememail1_.SEND_MAIL_IND as x9_0_ from T_TKWQ_WORK_QUE ttkwqworkq0_ left outer join T_TKEM_EMAIL_NOTICE ttkememail1_ on ttkwqworkq0_.QUE_ID=ttkememail1_.QUEUE_ID where (ttkwqworkq0_.QUE_ID=? )AND(ttkwqworkq0_.ORG_ID=? )
[ERROR] catalog - -com.fmr.xtrac.catalog:E_Persistence - Error occurred in persistence operation: No column name found for property [usr_Scty_Grp_Id] [select {trnsfscty}.USR_SCTY_GRP_ID as {trnsfscty.usr_Scty_Grp_Id}, {trnsfsctygrp}.USR_SCTY_GRP_ID as {trnsfsctygrp.usr_Scty_Grp_Id} {trnsfsctygrp}.usr_Scty_Grp_Desc as {trnsfsctygrp.usr_Scty_Grp_Desc} from T_TKTS_TRNF_SCTY {trnsfscty} right outer join T_TKSG_SCTY_GRP {trnsfsctygrp} on {trnsfscty.usr_Scty_Grp_Id}= {trnsfsctygrp.usr_Scty_Grp_Id} AND {trnsfscty}.QUE_ID= :que_id AND {trnsfscty}.ORG_ID= :org_id ]
com.fmr.xtrac.catalog.E_Persistence: com.fmr.xtrac.catalog:E_Persistence - Error occurred in persistence operation: No column name found for property [usr_Scty_Grp_Id] [select {trnsfscty}.USR_SCTY_GRP_ID as {trnsfscty.usr_Scty_Grp_Id}, {trnsfsctygrp}.USR_SCTY_GRP_ID as {trnsfsctygrp.usr_Scty_Grp_Id} {trnsfsctygrp}.usr_Scty_Grp_Desc as {trnsfsctygrp.usr_Scty_Grp_Desc} from T_TKTS_TRNF_SCTY {trnsfscty} right outer join T_TKSG_SCTY_GRP {trnsfsctygrp} on {trnsfscty.usr_Scty_Grp_Id}= {trnsfsctygrp.usr_Scty_Grp_Id} AND {trnsfscty}.QUE_ID= :que_id AND {trnsfscty}.ORG_ID= :org_id ]
at com.fmr.xtrac.catalog.E_Persistence.throwExc(E_Persistence.java:630)
at com.fmr.xtrac.dao.TTkwqWorkQueDAO.retrieve(TTkwqWorkQueDAO.java:336)
at com.fmr.xtrac.dao.TTkwqWorkQueDAO.main(TTkwqWorkQueDAO.java:55)
Exception in thread "main"
Name and version of the database you are using:
Oracle 9i
The generated SQL (show_sql=true):
select {trnsfscty}.USR_SCTY_GRP_ID as {trnsfscty.usr_Scty_Grp_Id}, {trnsfsctygrp}.USR_SCTY_GRP_ID as {trnsfsctygrp.usr_Scty_Grp_Id} {trnsfsctygrp}.usr_Scty_Grp_Desc as {trnsfsctygrp.usr_Scty_Grp_Desc} from T_TKTS_TRNF_SCTY {trnsfscty} right outer join T_TKSG_SCTY_GRP {trnsfsctygrp} on {trnsfscty.usr_Scty_Grp_Id}= {trnsfsctygrp.usr_Scty_Grp_Id} AND {trnsfscty}.QUE_ID= :que_id AND {trnsfscty}.ORG_ID= :org_id
Debug level Hibernate log excerpt:
I am trying to write a native sql in hibernate using createSQLQuery method of Session class and getting an error "No column name found for property [usr_Scty_Grp_Id]".
The code is follows
Query query =
session.createSQLQuery(
"select
{trnsfscty}.USR_SCTY_GRP_ID as {trnsfscty.usr_Scty_Grp_Id}, {trnsfsctygrp}.USR_SCTY_GRP_ID as {trnsfsctygrp.usr_Scty_Grp_Id} {trnsfsctygrp}.usr_Scty_Grp_Desc as {trnsfsctygrp.usr_Scty_Grp_Desc} "
from T_TKTS_TRNF_SCTY {trnsfscty} right outer join
T_TKSG_SCTY_GRP {trnsfsctygrp}
on {trnsfscty.usr_Scty_Grp_Id}= {trnsfsctygrp.usr_Scty_Grp_Id}
AND {trnsfscty}.QUE_ID= :que_id
AND {trnsfscty}.ORG_ID= :org_id ",
new String[] {"trnsfscty","trnsfsctygrp"},
new Class[] {com.fmr.xtrac.hibernate.TTktsTrnfScty.class,
com.fmr.xtrac.hibernate.TTksgSctyGrp.class});
query.setString("que_id","");
query.setBigDecimal("org_id",new BigDecimal(95));
My table definition is as follows:
SQL> desc T_TKTS_TRNF_SCTY
Name Null? Type
----------------------------------------- -------- ----------------------------
QUE_ID NOT NULL VARCHAR2(7)
USR_SCTY_GRP_ID NOT NULL VARCHAR2(10)
SYS_ADM_GRP_C NOT NULL VARCHAR2(4)
CRE_OPER_ID NOT NULL VARCHAR2(7)
CRE_D NOT NULL DATE
MOD_OPER_ID NOT NULL VARCHAR2(7)
MOD_D NOT NULL DATE
DEL_I NOT NULL CHAR(1)
ORG_ID NOT NULL NUMBER
SQL> desc T_TKSG_SCTY_GRP
Name Null? Type
----------------------------------------- -------- ----------------------------
USR_SCTY_GRP_ID NOT NULL VARCHAR2(10)
USR_SCTY_GRP_DESC NOT NULL VARCHAR2(30)
SYS_ADM_GRP_C NOT NULL VARCHAR2(4)
MAX_PSWD_AGE_N NOT NULL NUMBER(5)
CRE_OPER_ID NOT NULL VARCHAR2(7)
CRE_D NOT NULL DATE
MOD_OPER_ID NOT NULL VARCHAR2(7)
MOD_D NOT NULL DATE
DEL_I NOT NULL CHAR(1)
ORG_ID NOT NULL NUMBER
The
class TTktsTrnfScty do have attribute usr_Scty_Grp_Id
and class TTksgSctyGrp do have attributes usr_Scty_Grp_Id ,usr_Scty_Grp_Desc.
Can you suggest what is the error in the sql?
|