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: Nhibernate query to get firstname lastname in single string
PostPosted: Tue Nov 25, 2008 2:53 am 
Newbie

Joined: Tue Sep 09, 2008 3:20 am
Posts: 17
Hi,

How to get th following sql query in Nhibernate.

select e.firstname || e.middlename|| e.lastname , e.employeecode,e from employees e

When i try to do the same using IQuery in Nhibernate it gives me error

Thanks

Arvind


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 25, 2008 4:06 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
What error do you get ? Have in mind, that if you do that query with HQL you need property names instead of column names and that the resultset will be a 3-dim array with { "concatenated name", employeecode, instance of e }.

But instead of doing this in HQL I suggest a property on Employee that will do the concatenation.

_________________
--Wolfgang


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.