-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Problem with Scrollable resultsets
PostPosted: Fri Apr 21, 2006 2:28 am 
Newbie

Joined: Fri Apr 21, 2006 1:47 am
Posts: 6
Hi,


We noticed that hql query like :

Code:

"select
    partner.PartnerId,partner.PartnerName,partner_loc.DsppCountry.CountryName,
      partner_loc.DsppCountry.CountryCode,detail.DsppPartnerTaxonomy.Name
from

DsppPartner partner
join partner.SetOfDsppPartnerManagement_1 partner_mgmt
join partner.DsppPartnerLocation partner_loc
join partner_mgmt.DsppPartnerTaxonomy_1.SetOfDsppPartnerTaxonomyDetail detail

where

(upper(partner.PartnerName) like upper('%next%') or
upper(partner_mgmt.PreviousPartnerName) like upper('%next%')) and
(partner_mgmt.MarkedForDeletion <> 1) and
detail.DsppLanguage.LangId = 1
order by partner.PartnerName"






executes properly with the Hiberrnate Version 3.0.0, but does not work with the Hibernate Version 3.1.3

Error that is being thrown up :


   EXCEPTION CLASS   : class org.hibernate.exception.GenericJDBCException
   EXCEPTION MESSAGE : could not execute query using scroll
   EXCEPTION CAUSE   : java.sql.SQLException: The column prefix 'dspppartne0_' does not match with a table name or alias              name used in the query.

NOte : also, the query does not execute with plain list method also (i.e. apart from using scroll method)



Investigation done :

with Hibernate Version 3.0.0, SQL string generated is :

[quote]

select dspppartne0_.partner_id as col_0_0_, dspppartne0_.partner_name as col_1_0_, dsppcountr5_.country_name as col_2_0_, dsppcountr5_.country_code as col_3_0_, dspppartne6_.name as col_4_0_ from dspp_partner dspppartne0_ inner join dspp_partner_management setofdsppp1_ on dspppartne0_.partner_id=setofdsppp1_.partner_id inner join dspp_partner_location dspppartne2_ on dspppartne0_.partner_location_id=dspppartne2_.location_id inner join dspp_partner_taxonomy dspppartne3_ on setofdsppp1_.membership_status=dspppartne3_.taxonomy_id inner join dspp_partner_taxonomy_detail setofdsppp4_ on dspppartne3_.taxonomy_id=setofdsppp4_.taxonomy_id, dspp_country dsppcountr5_, dspp_partner_taxonomy dspppartne6_ where dspppartne2_.country=dsppcountr5_.country_id and setofdsppp4_.taxonomy_id=dspppartne6_.taxonomy_id and (((upper(dspppartne0_.partner_name)like upper('%next%'))or(upper(setofdsppp1_.previous_partner_name)like upper('%next%')))and((setofdsppp1_.marked_for_deletion<>1 ))and(setofdsppp4_.lang_id=1 )) order by  dspppartne0_.partner_name

[/quote]

The above SQL string of Hibernate Version 3.0.0 executes properly in SQL Query Analyzer and gives results,


with Hibernate Version 3.1.3, SQL string generated is :

[quote]

select dspppartne0_.partner_id as col_0_0_, dspppartne0_.partner_name as col_1_0_, dsppcountr5_.country_name as col_2_0_, dsppcountr5_.country_code as col_3_0_, dspppartne7_.name as col_4_0_ from dspp_partner dspppartne0_ inner join dspp_partner_management setofdsppp1_ on dspppartne0_.partner_id=setofdsppp1_.partner_id inner join dspp_partner_taxonomy dspppartne3_ on setofdsppp1_.membership_status=dspppartne3_.taxonomy_id inner join dspp_partner_taxonomy_detail setofdsppp4_ on dspppartne3_.taxonomy_id=setofdsppp4_.taxonomy_id, dspp_partner_taxonomy dspppartne7_ inner join dspp_partner_location dspppartne2_ on dspppartne0_.partner_location_id=dspppartne2_.location_id, dspp_country dsppcountr5_ where dspppartne2_.country=dsppcountr5_.country_id and setofdsppp4_.taxonomy_id=dspppartne7_.taxonomy_id and (upper(dspppartne0_.partner_name) like upper('%next%') or upper(setofdsppp1_.previous_partner_name) like upper('%next%')) and setofdsppp1_.marked_for_deletion<>1 and setofdsppp4_.lang_id=1 order by dspppartne0_.partner_name

[/quote]





but SQL string of Hibernate Version 3.1.3 throws up this error :

Server: Msg 107, Level 16, State 2, Line 1
The column prefix 'dspppartne0_' does not match with a table name or alias name used in the query.


JDBC Driver used : Microsoft JDBC Type4 driver (com.microsoft.jdbc.sqlserver.SQLServerDriver)



If anybody can throw any light on this issue, it would be of great help. Please its very urgent and blocking issue.


Thanks & Regards,
Devesh


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.