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