java - could not read column value from result set in Hibernate Native Query -
select concat(creg.firstname, ' ', creg.lastname) name, case when cr.campaigntype = 'nps' npsscore else csatscore end score, ifnull(cast(cc.text char(255)), '') comments, creg.id clientid, cr.id campaignresponseid, ci.id issueid customer_issues ci inner join (select distinct issueid issue_department_mapping customeruserid = 91 , issue_status = 'new') idm on cast(ci.feedback_date date) between '2016-06-05' , '2016-06-11' , idm.issueid = ci.id inner join campaign_response cr on cr.id = ci.campaign_response_id inner join client_registration creg on creg.id = cr.responsecustomerid left outer join campaign_comments cc on cc.campaign_response_id = cr.id;
the above query running in mysql-console ,but when integrating hibernate,following error thrown hibernate.
[bigintegertype] not read column value result set: id; column 'id' not found.
try getting rid of alias names in sql query.
basically happens here when run
select concat(creg.firstname, ' ', creg.lastname) name, case when cr.campaigntype = 'nps' npsscore else csatscore end score, ifnull(cast(cc.text char(255)), '') comments, creg.id clientid, cr.id campaignresponseid, ci.id issueid
in jdbc returns column creg.id instead of clientid. try running query without aliases, typically, there problem in jdbc this. if still insist on using aliases,add following entry jdbc url in configuration file
[useoldaliasmetadatabehavior=true]
Comments
Post a Comment