views:

8

answers:

0

I want to create a strongly type object from a fluent NHibernate query. If I were using HQL and NHibernate I belive I would need:

the class for the output

Namespace Model
    Public Class namecount
        Public Overridable Property lastname() as string ...
        Public Overridable Property lastnamecount() as integer ...
        Public Sub New(lastname as string, count as integer) ...
    End Class
End Namespace

an .hbm.xml file

<?xml ...>
<hibernate-mapping ...>
  <import class="model.namecount,model"> 
</hibernate-mapping>

and of course the query

_session.createquery("select new namecount(lastname, count(lastname)) ...")

(The above is a paraphrased example taken from one of the 2008 SummerofNHibernate videos)

I cannot find any examples of how to do this with fluent (even in C#), is it possible? If it isn't is there a VB example of how to mix Fluent and .hbm.xml