-->
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: help: the hql can't run on sql server
PostPosted: Wed Jul 13, 2005 11:31 pm 
Regular
Regular

Joined: Sat Apr 10, 2004 8:39 pm
Posts: 84
the HQL can't run on SQL Server. but no problem on HSQLDB.

the reason is:

select x from X x, Y y

join x ---------- error


on sql server it must be

select x from X x
cross join Y y
join ...................

how to?

SQLServerDialect can't change "from table1, table2" to " from table cross join table2" ?




[WARN ] [2005-07-14 09:28:08,781] net.sf.hibernate.util.JDBCExceptionReporter - SQL Error: 107, SQLState: S1000
[ERROR] [2005-07-14 09:28:08,796] net.sf.hibernate.util.JDBCExceptionReporter - column'prefix 'accessrequ0_' doesn't match to the table name or alias in query string



Code:



            StringBuffer hql = new StringBuffer();
            
            hql.append(" select distinct accessRequest from AccessRequest accessRequest ");
            
            hql.append(", UserDetails userDetails ");
//SQL Server   hql.append(" cross join UserDetails userDetails ");
//error   return      hql.append(" join accessRequest.userDetails userDetails");
            
            hql.append(" join userDetails.setOfUserGroupRelation userGroupRelation ");
            hql.append(" join userGroupRelation.uniformGroup userGroup ");
            hql.append(" join userDetails.setOfAuthorities authorities ");
            hql.append(" join authorities.id.roleDefiniens userRole ");
            
//......            
            hql.append(" join accessRequest.setOfRequestXfileBorrow borrow ");
            hql.append(" join borrow.xfile xfileBorrow ");
            hql.append(" join xfileBorrow.xource xourceBorrow ");
            hql.append(" join xourceBorrow.setOfXourceGroupRelation xourceBorrowGroupRelation ");
            hql.append(" join xourceBorrowGroupRelation.uniformGroup xourceBorrowGroup ");
            
            hql.append(" join borrow.accessRuleTache borrowTache ");
            hql.append(" join borrowTache.roleDefiniens borrowTacheRole ");
//            hql.append(" join accessRequest.setOfRequestXfileDestory destory ");
//            hql.append(" join accessRequest.setOfRequestXfileSend send ");
            hql.append(" where (userDetails.relId=:relId) ");
            hql.append(" and (userGroup.relId=xourceBorrowGroup.relId) ");
            hql.append(" and (userRole.symbol=borrowTacheRole) ");
            hql.append("");


_________________
I am the creatxr of world.


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.