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.  [ 8 posts ] 
Author Message
 Post subject: Exceptional query -- help needed, SOS
PostPosted: Fri Jan 05, 2007 5:29 am 
Beginner
Beginner

Joined: Fri Dec 01, 2006 5:16 am
Posts: 23
Location: India
Hi,

I am writing a query , in which the select cause contains a column of type [i]"Iesi.Collections.ISet"[/i].

If i mention the column name, i get an execption
[i]{"undefined alias or unknown mapping: m [select m.Annotation_s from com.ml.ps.data.Movement p]"}[/i]

The query i am trying to run is
[i]select m.Annotation_s from com.ml.ps.data.Movement p[/i]

where Annotation_s is of type ISet.

Help or pointer's will be greatly appreciated.

Thankz,
Raul


Top
 Profile  
 
 Post subject: Re: Exceptional query -- help needed, SOS
PostPosted: Fri Jan 05, 2007 7:11 am 
Expert
Expert

Joined: Thu Jan 19, 2006 4:29 pm
Posts: 348
Raul wrote:
The query i am trying to run is
select m.Annotation_s from com.ml.ps.data.Movement p

where Annotation_s is of type ISet.

Help or pointer's will be greatly appreciated.


Note "p" in "Movement p" and "m" in "m.Annotation_s ". You probably wanty change one of them.

Gert

_________________
If a reply helps You, rate it!


Top
 Profile  
 
 Post subject: Re: Exceptional query -- help needed, SOS
PostPosted: Fri Jan 05, 2007 7:31 am 
Beginner
Beginner

Joined: Fri Dec 01, 2006 5:16 am
Posts: 23
Location: India
sorry, that was a silly mistake from me, after correcting the query , the query reads

[i]select m.Annotation_s from com.ml.ps.data.Movement m[/i]

The execption i rec. now is:

[i]{"expecting 'elements' or 'indices' after id [select m.Annotation_s from com.ml.ps.data.Movement m]"}[/i]

Help would be appreciated.

Thankz,
Raul


Top
 Profile  
 
 Post subject: Re: Exceptional query -- help needed, SOS
PostPosted: Fri Jan 05, 2007 7:38 am 
Expert
Expert

Joined: Thu Jan 19, 2006 4:29 pm
Posts: 348
Raul wrote:
sorry, that was a silly mistake from me, after correcting the query , the query reads

select m.Annotation_s from com.ml.ps.data.Movement m

The execption i rec. now is:

{"expecting 'elements' or 'indices' after id [select m.Annotation_s from com.ml.ps.data.Movement m]"}

Help would be appreciated.

Thankz,
Raul

You probaly want
select elements(m.Annotation_s) from com.ml.ps.data.Movement m

see http://www.hibernate.org/hib_docs/nhibernate/html/queryhql.html#queryhql-select

Gert

_________________
If a reply helps You, rate it!


Top
 Profile  
 
 Post subject: Re: Exceptional query -- help needed, SOS
PostPosted: Fri Jan 05, 2007 8:32 am 
Beginner
Beginner

Joined: Fri Dec 01, 2006 5:16 am
Posts: 23
Location: India
I corrected the query to :
select elements(m.ExplicitTags) from com.ml.ps.data.Movement m

Now i am getting the exception
InnerException = {"could not load by id: [com.ml.ps.data.Category#1001]"}

Help will be appreciated.

Thankz,
Raul


Top
 Profile  
 
 Post subject: Re: Exceptional query -- help needed, SOS
PostPosted: Fri Jan 05, 2007 9:28 am 
Beginner
Beginner

Joined: Fri Dec 01, 2006 5:16 am
Posts: 23
Location: India
Gert,

Thanks Gert, though the problem is still not over, however in some cases this it is working well.

Great!!!.

Thanks once again.
Raul


Top
 Profile  
 
 Post subject: Re: Exceptional query -- help needed, SOS
PostPosted: Fri Jan 05, 2007 10:18 am 
Expert
Expert

Joined: Thu Jan 19, 2006 4:29 pm
Posts: 348
Raul wrote:
InnerException = {"could not load by id: [com.ml.ps.data.Category#1001]"}


Sounds like the category with id=1001 is referenced somewhere, but that Category is not present in database.

Gert

_________________
If a reply helps You, rate it!


Top
 Profile  
 
 Post subject: Re: Exceptional query -- help needed, SOS
PostPosted: Fri Jan 05, 2007 10:22 am 
Beginner
Beginner

Joined: Fri Dec 01, 2006 5:16 am
Posts: 23
Location: India
Hi,

Now the exception has been removed, however no rows are bieng retrived.

The code i am using is :

[i]IQuery sqlQuery = session.CreateQuery(" select m.Annotation_s.elements from com.ml.ps.data.Movement m ");

Transaction = sqlQuery.List();[/i]

[b]The Transaction.Count is coming as 0.[/b]

But, When we fire the query in Oracle , it returns a single (1) record.

Help will be appreciated.

Thankz,
Raul


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 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.