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>

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.