-->
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.  [ 3 posts ] 
Author Message
 Post subject: SQL Query
PostPosted: Thu Dec 23, 2004 1:25 pm 
Newbie

Joined: Mon Dec 13, 2004 12:37 pm
Posts: 18
I have defined an sql query and defined the hibernate return classes using the <sql-query> mapping tag. However, I wonder if it is possible to get some other value from the query that is not actually a class? I.e. some other string or integer column.

<sql-query>
<return alias="alias1" class="class1">
<return alias="alias2" class="class2">
select {alias1.*}, {alias2.*}, other.some_value
from table1 alias1, table2 alias2, table3 other
</sql-query>

Thanks,
Thomas


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 23, 2004 6:48 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
No, this is currently not possible.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 24, 2004 7:54 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Actually it is useful in very specific cases since the best framework for scalar returns from a SQL query is... JDBC. The only combination of an entity and a scalar result is revelent (provided that you couldn't have used HQL).

_________________
Emmanuel


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