-->
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.  [ 2 posts ] 
Author Message
 Post subject: Error
PostPosted: Thu Dec 22, 2005 7:34 am 
I have two table Dbr, Grouopdata. I have there mapping class and mapping file. Dbr table has DbrId as primary key which is a foreign Key in Groupdata.Mapping files does not contain the their link info

Now i am trying the following code :

Dim aliasCls As String() = {"l", "e"}
Dim clazz As System.Type() = {GetType(Databaseobj.Dbr), GetType(Databaseobj.Groupdata)
mySelectQuery = "select * from Dbr inner join Groupdata on Groupdata.Groupid =Dbr.GroupID" 'where Groupdata.groupid=" + Convert.ToString(16)
Dim Qry As IList = nhibersession2.CreateSQLQuery(mySelectQuery, aliasCls, clazz).List()


this giving the following error :
System.IndexOutOfRangeException: DbrId0_


what to do ?

Gaurav


Top
  
 
 Post subject: Re: Error
PostPosted: Thu Dec 22, 2005 5:49 pm 
Senior
Senior

Joined: Wed Jun 15, 2005 4:17 am
Posts: 156
Gaurav wrote:
what to do ?


Read chapter 9.3.6 in Hibernate docs:
Quote:
You must enclose SQL aliases in braces


Or better, rewrite the query in HQL
BTW, I also recommend you to use parameterized queries.

Cheers,
Radu


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

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.