views:

39

answers:

1

So for a project that we are working on we have our entire domain model mapped using mapping-attributes on the business entities themselves. I have a working sql-query mapping that I would like to define using the mapping-attributes but I am not sure how to do this. Any help is appreciated.

Here is the xml mapping that needs to be translated:

<sql-query name="Query1">
<return class="My.Class, My.Assembly">
    <return-property name="Field1" column="Field1"/>
    <return-property name="Field2" column="Field2"/>
    <return-property name="Field3" column="Field3"/>
    <return-property name="Field4" column="Field4"/>
    <return-property name="Field5" column="Field5"/>
    <return-property name="Field6" column="Field6"/>
    <return-property name="Field7" column="Field7"/>
    <return-property name="Field8" column="Field8"/>
    <return-property name="Field9" column="Field9" />
</return>
select Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9 from dbo.udf_CUSTOM (:Param1, :Param2, :Param3)
</sql-query>
+2  A: 

It's not supported by nHibernate mapping attributes. You can define an external XML mapping if you really need to use them.

Please consider fluent nhibernate. It's an even better way to map your objects.

Pierre 303
We are trying to migrate a EXTEREMELY large application to fluent nhibernate. We need stake-holder buy-in. Until then, I am trying any thing I can. Can I do this with the RawXml attribute?
Phobis