How does Fluent NHibernate support the Import Entity

Bender's Avatar

Bender

13 Apr, 2010 02:33 PM via web

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

    Reply to this discussion

    Preview Comments are parsed with Markdown. Help with syntax

    Attached Files

      You can attach files up to 10MB

      What month comes before July?