-->
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: Including literal values in select clause of HQL
PostPosted: Thu Oct 23, 2003 2:42 pm 
Newbie

Joined: Wed Aug 27, 2003 2:53 pm
Posts: 14
Location: New Jersey
Is it possible to include a literal value in the select clause of an HQL query? For example, in an hbm file,

Code:
   <query name="org.ets.k12.generic.domain.Organization.byCDS"><![CDATA[
      select org.orgIdNumber, 1 from org in class org.ets.k12.generic.domain.Organization where org.cdsCode = ?
   ]]></query>


The reason that I want to do this is I have a Java method that will execute one of a number of queries and I need the results of all the queries to be structurally equivalent so that the calling code can access the results in an identical fashion. So I need to add a "dummy" column to the results of this query.

I didn't see any discussion of this in Chapter 9 of the Hibernate documentation and it doesn't seem to work. Hibernate gives an error saying that "1" is an undefined alias.

Thanks,

Sarah


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 23, 2003 2:47 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
no, sorry...


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.