-->
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.  [ 5 posts ] 
Author Message
 Post subject: The multi-part identifier "this.status" could not
PostPosted: Mon Feb 26, 2007 11:16 pm 
Beginner
Beginner

Joined: Mon Sep 26, 2005 5:57 pm
Posts: 39
In version 1.04, I used to be able to add a sql expression to criteria object like:

criteria.Add(Expression.SQL("this.status='X'))

In version 1.2, such code throws a SQL Exception: The multi-part identifier "this.status" could not be bound.

Am I missing something?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 27, 2007 1:55 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
You should be using {alias} instead of this.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 27, 2007 2:36 pm 
Beginner
Beginner

Joined: Mon Sep 26, 2005 5:57 pm
Posts: 39
Is there any other way besides {alias}. This messes up all the SQL strings formatted with string.format (because of the curly brackets)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 23, 2007 11:37 am 
Newbie

Joined: Mon Jul 23, 2007 11:35 am
Posts: 1
You can use {alias} within a string.Format by doubling-up the braces, like this: "{{alias}}" String.Format will ignore double braces, kind of like an escape sequence.


Top
 Profile  
 
 Post subject: i'm confused!
PostPosted: Sun Dec 30, 2007 12:12 pm 
Newbie

Joined: Sun May 14, 2006 8:48 am
Posts: 12
did you say "we can use '{alias}' in our query"? please explain me more.

for example can i write a query like below?

SELECT {alias}.Name FROM ContactEntity AS ContactEntity

I confused! if yes, please explain more.

thanks in advance


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