Home

Castle Stronghold

Castle Project Forum Index Castle Project
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

outer or full join must be followed by path expression

 
Post new topic   Reply to topic    Castle Project Forum Index -> AR Usage
View previous topic :: View next topic  
Author Message
microshot



Joined: 16 Aug 2006
Posts: 35

PostPosted: Thu Aug 24, 2006 2:11 am    Post subject: outer or full join must be followed by path expression Reply with quote

I define the function:

Code:
      public IList SelectLine(int lineid)
      {
         SimpleQuery query = new SimpleQuery(typeof(MBUSTIMEPLANSURVEY),typeof(System.Decimal),
            @"select a.AUTOID from MBUSTIMEPLANSURVEY a inner join TDUTYTYPE b on a.AUTOID=b.AUTOID where a.LINEID=?",
            lineid);
         return (IList)ExecuteQuery(query);
      }


error:

"outer or full join must be followed by path expression [select a.AUTOID from ZtDimsModel.MBUSTIMEPLANSURVEY a inner join TDUTYTYPE b on a.AUTOID=b.AUTOID where a.LINEID=?]"

the hql error?

If I need sql:
select a.AUTOID,b.busid from MBUSTIMEPLANSURVEY a inner join TDUTYTYPE b on a.AUTOID=b.AUTOID where a.LINEID=?

How can I write the function?
Code:
SimpleQuery query = new SimpleQuery(typeof(???),typeof(???)............

_________________
I'm come from China, more and more Chinese becoming use your project into the development:)
Back to top
View user's profile Send private message
fabio
Castle Team


Joined: 22 Apr 2006
Posts: 118
Location: Porto Alegre, RS / Brasil

PostPosted: Thu Aug 24, 2006 3:31 am    Post subject: Reply with quote

HQL join does not have an ON clause. It uses path expressions, which are translated to SQL JOIN clauses.

See: http://www.hibernate.org/hib_docs/reference/en/html/queryhql.html

Your query should look something like:

Code:
select a.AUTOID from MBUSTIMEPLANSURVEY a inner join a.DUTYTYPES b where a.LINEID=?


But the following is also valid:

Code:
select a.AUTOID from MBUSTIMEPLANSURVEY a, TDUTYTYPE b where a.AUTOID=b.AUTOID and a.LINEID=?

_________________
Fábio Batista
my blog: http://nerd-o-matic.blogspot.com/
my company: http://suprifattus.com.br/
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
microshot



Joined: 16 Aug 2006
Posts: 35

PostPosted: Thu Aug 24, 2006 4:36 am    Post subject: Reply with quote

o, I know Very Happy
thank you!
_________________
I'm come from China, more and more Chinese becoming use your project into the development:)
Back to top
View user's profile Send private message
fabio
Castle Team


Joined: 22 Apr 2006
Posts: 118
Location: Porto Alegre, RS / Brasil

PostPosted: Thu Aug 24, 2006 3:16 pm    Post subject: Reply with quote

Split to: http://forum.castleproject.org/viewtopic.php?t=1025
_________________
Fábio Batista
my blog: http://nerd-o-matic.blogspot.com/
my company: http://suprifattus.com.br/
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Castle Project Forum Index -> AR Usage All times are GMT
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group