An intermediary option would be not to map queries (no <sql-query> support),
but do allow the <loader /> stuff to be specified for a class. That way
users can write the queries in hbm, but reference them without having to
write their class mapping in hbm too.
Honestly, I don't care either way. If we're looking to replicate every
feature of hbm fluently, then we should have it in, but if we're going to
selectively choose features then I'd opt not to do it.

On Tue, Dec 23, 2008 at 3:49 PM, Ayende Rahien <aye...@ayende.com> wrote:

> Why?
> This is certainly not something that can be called fluent. You allow to mix
> & match xml & fluent config anyway.
> I would say that this should be out of scope for FN
>
> On Tue, Dec 23, 2008 at 4:49 PM, Chad Myers <c...@chadmyers.com> wrote:
>
>>
>> Hey now, there are a few reasons you might use an sp with nhib. And
>> anyhow, nhib supports it, so should we.
>>
>>
>> ----------------------
>> Sent from my phone.  Please excuse typos and extra characters
>>
>> -----Original Message-----
>> From: Paul Batum <paul.ba...@gmail.com>
>> Sent: Tuesday, December 23, 2008 3:48 AM
>> To: fluent-nhibernate@googlegroups.com <
>> fluent-nhibernate@googlegroups.com>
>> Subject: [fluent-nhib] Re: Stored Procedure automapping
>>
>> Ahh I see. That looks ok.
>>
>> Of course, it won't protect you from changes made on the SP side, but
>> thats
>> one of the many reasons why we both hate SP's, isnt it!
>>
>> On Tue, Dec 23, 2008 at 8:40 PM, James Gregory <jagregory....@gmail.com
>> >wrote:
>>
>> > Chris, really, why would you want to use stored procedures in
>> NHibernate?
>> > @Paul: I'd say the return-property element could be mapped using
>> > expressions.
>> >
>> > Something along the lines of:
>> >
>> > class EmploymentMap : ClassMap<Employment>
>> > {
>> >   public EmploymentMap()
>> >   {
>> >     Map(x => x.Employee);
>> >     Map(x => x.Employer);
>> >
>> >     SqlQuery("selectAllEmployments_SP", sql =>
>> >     {
>> >       sql.Return
>> >         .Property(x => x.Employee, "EMPLOYEE")
>> >         .Property(x => x.Employer, "EMPLOYER");
>> >
>> >       sql.Text = "exec selectAllEmployments";
>> >     });
>> >   }
>> > }
>> >
>> > It's not brilliant, but it wouldn't break with renaming of properties. I
>> vehemously
>> > oppose using stored procedures, but this feature can also be applied to
>> > performance tweaked sql queries, so it's probably something we should
>> pursue
>> > at some point.
>> >
>> >
>> > On Tue, Dec 23, 2008 at 3:47 AM, Paul Batum <paul.ba...@gmail.com>
>> wrote:
>> >
>> >> It looks like its all strings and none of it would be derivable from
>> the
>> >> domain model. I'm struggling to imagine an API that would be worth it.
>> Did
>> >> you have any ideas?
>> >>
>> >>
>> >> On Tue, Dec 23, 2008 at 10:52 AM, Chris Marisic <
>> chrismari...@hotmail.com
>> >> > wrote:
>> >>
>> >>>
>> >>> This is a mapping I found quick online
>> >>>
>> >>>    <sql-query name="selectAllEmployments_SP">
>> >>>        <return alias="emp" class="Employment">
>> >>>            <return-property name="employee" column="EMPLOYEE"/>
>> >>>            <return-property name="employer" column="EMPLOYER"/>
>> >>>            <return-property name="startDate" column="STARTDATE"/>
>> >>>            <return-property name="endDate" column="ENDDATE"/>
>> >>>            <return-property name="regionCode" column="REGIONCODE"/>
>> >>>            <return-property name="id" column="EID"/>
>> >>>            <return-property name="salary">
>> >>>                <return-column name="VALUE"/>
>> >>>                <return-column name="CURRENCY"/>
>> >>>            </return-property>
>> >>>        </return>
>> >>>        exec selectAllEmployments
>> >>>    </sql-query>
>> >>>
>> >>>
>> >>
>> >>
>> >>
>> >
>> > >
>> >
>>
>>
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibernate@googlegroups.com
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to