It's certainly lower priority, I'll give you that.
 
But using stored procedures with NHibernate has some friction and opportunity 
for typos, misnaming, etc, so I think there's value that FN could add here 
somehow to help reduce typos and such.
 
-c

________________________________

From: fluent-nhibernate@googlegroups.com on behalf of Ayende Rahien
Sent: Tue 12/23/2008 9:49 AM
To: fluent-nhibernate@googlegroups.com
Subject: [fluent-nhib] Re: Stored Procedure automapping


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.com 
<http://jagregory.com/> @gmail.com <http://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
-~----------~----~----~----~------~----~------~--~---

<<inline: winmail.dat>>

Reply via email to