Oh my god wow!  This seems to be very close to what I wanted, I'm
going to try it out right now.

I suppose if I wanted to return the DataReader (or DataSet) rather
than an IDictionary I would write my own EntityMode?

On Mar 5, 8:04 pm, Diego Mijelshon <[email protected]> wrote:
> Use EntityMode.Map.
> Here's a 
> link:http://nhforge.org/blogs/nhibernate/archive/2008/10/16/less-than-gof-...
> <http://nhforge.org/blogs/nhibernate/archive/2008/10/16/less-than-gof-...>You'll
> basically work with PropertyName/PropertyValue dictionaries, and no classes.
>
>    Diego
>
>
>
> On Fri, Mar 5, 2010 at 20:07, George Mauer <[email protected]> wrote:
> > In this one case I think that I know what I'm doing...
>
> > The DataReader would be good because in certain cases we will be
> > pulling out a lot of data and simply displaying it in a WPF grid
> > without applying much logic (or rather, there is a separate
> > abstraction that applies logic).  Rather than draw out a data-reader,
> > map to entities and then have the WPF grid consume those, it would be
> > nifty to simply pass off the DataReader directly from a query.
>
> > Why not just run SQL directly?  Because I have absolutely zero desire
> > to handle caching and concurrency manually.  Oh and because this
> > functionality has to be database agnostic.
>
> > This is especially so because the domain model is completely up in the
> > air.  The user defines what the tables and columns will be during
> > runtime and we're actually going to go and create them behind the
> > scenes.  Yes I'm not comfortable with this but there are several very
> > good reasons why it should be this way.  We're going to use the
> > dynamic-component mappings to achieve some of this.  What it means is
> > since every "domain object" is going to be essentially an Id paired
> > with an IDictionary it would be best to not have to worry about having
> > these objects defined in code at all and only define them in xml where
> > we can make changes by modifying the underlying mapping files in code
> > and rebuilding the session factory.
>
> > Yes this isn't quite what NH was meant for, but I'm willing to make
> > the investment to bend it to my will if I can get caching, concurrency
> > management, and db-agnosticism for free.
>
> > On Mar 5, 4:53 pm, "Cesar Sanz" <[email protected]> wrote:
> > > Why do you need the DataReader?
> > > Is it not better to utilize Entities?
>
> > > slts
>
> > > ----- Original Message -----
> > > From: "George Mauer" <[email protected]>
> > > To: "nhusers" <[email protected]>
> > > Sent: Friday, March 05, 2010 2:41 PM
> > > Subject: [nhusers] Is it possible to get at the underlying
> > > DataReader/DataSet?
>
> > > > Hi,
> > > > I would like to get at the underlying DataReader or DataSet that
> > > > NHibernate uses to populate its entities.  Ideally I would like to be
> > > > able to do something like this:
>
> > > > DataReader customersReader = session.CreateQuery("from
> > > > DynamicCustomers").DataReader();
>
> > > > Is this possible?
>
> > > > It would be better if I didn't even have an actual DynamicCustomers
> > > > class, only the hbm mappings.
>
> > > > I'm not above forking the NH source to achieve this but I'm hoping
> > > > that there's an extensibility hook I can use.  Can anyone point me
> > > > down the right path?
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "nhusers" group.
> > > > To post to this group, send email to [email protected].
> > > > To unsubscribe from this group, send email to
> > > > [email protected]<nhusers%[email protected]
> > > >  >
> > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/nhusers?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "nhusers" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<nhusers%[email protected] 
> > >
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/nhusers?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to