-->
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: createSQLQuery question
PostPosted: Mon Mar 29, 2004 11:47 am 
Newbie

Joined: Mon Sep 08, 2003 12:37 pm
Posts: 10
Hi!


I have the following statement:

"select {user}.userID as {user.userId} from tuser {user},tglobaluser_role {gur}, trole {role} where {role}.roleid={gur}.roleid and {role}.name=:roleName and {user}.userID={gur}.userID"

After calling query.list() i've got:

java.sql.SQLException: Column 'GlobalUs1_1_' not found.
at com.mysql.jdbc.ResultSet.findColumn(ResultSet.java:2324)
at com.mysql.jdbc.ResultSet.getLong(ResultSet.java:1381)
at net.sf.hibernate.type.LongType.get(LongType.java:18)
at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:62)
at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:53)
at net.sf.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:352)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:203)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:950)
at net.sf.hibernate.loader.Loader.list(Loader.java:941)
at net.sf.hibernate.loader.SQLLoader.list(SQLLoader.java:92)
at net.sf.hibernate.impl.SessionImpl.findBySQL(SessionImpl.java:3764)
at net.sf.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:52)
at ifx.cim.backend.facade.hibernate.BackendServicesImpl.findUsersByRole(BackendServicesImpl.java:255)

How can i select a full user from my user table. I have to use createSQLQuery, because i have to make union of 3 select statements (the other 2 selects are not there in the above example).

Any help appreciated....


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.