-->
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: Report query into a new transient object
PostPosted: Mon Sep 12, 2005 4:18 am 
Senior
Senior

Joined: Sat Sep 10, 2005 3:46 pm
Posts: 178
Does Nhibernate support selecting fields into a transient object as described in the Hibernate in Action book?

I have attempted this with the following query:

Code:
Select new RemoteNet.Model.IDValueItem(dept.Id, dept.Name)from Department as dept where dept.Status = ? order by dept.Name


but i get an error stating that the class cant be found.

I have tried this with the simple class name, the fully qualified name and the fullyqualified assembly name with no luck.

Thanks for any help.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 12, 2005 4:34 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Yes it does, but due to .NET type name syntax (the type must include the assembly name, separated by a comma) the only practical way to make it work is to use an <import> element in your mappings, with the fully qualified name.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 12, 2005 5:05 am 
Senior
Senior

Joined: Sat Sep 10, 2005 3:46 pm
Posts: 178
I added the import statement to one of my mapping files and it worked like a charm.

Thanks sergey, your the man!


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.