Can't you use reflection to find them in a particular namespace or whatever and then just call this method repeatedly?
On Thu, Nov 26, 2009 at 6:53 AM, av <[email protected]> wrote: > Thanks > > Is there any way to bulk "import" a bunch of these? > > On Nov 25, 2:37 pm, James Gregory <[email protected]> wrote: > > You can use ImportType<YourType>() in your ClassMap definition. > > > > On Wed, Nov 25, 2009 at 7:14 PM, av <[email protected]> wrote: > > > Looking to do something like what was mentioned in the Nhibernate in > > > Action below. Besides including an hbm mapping file, is there a > > > "fluent" way of importing non-mapped types? thanks > > > > > "Using dynamic instantiation > > > If you don’t find working with arrays of values a little cumbersome, > > > NHibernate let’s us use dynamic > > > instantiation and define a class to represent each row of results. We > > > can do this using the HQL select > > > new construct: > > > select new ItemRow( item.id, item.Description, bid.Amount ) > > > from Item item join item.Bids bid > > > where bid.Amount > 100 > > > The ItemRow class is one we’d write just for our report screen, and > > > note that we also have to give it an > > > appropriate constructor. This query returns newly instantiated (but > > > transient) instances of ItemRow, as > > > you can see in the next example: > > > IList results = session.CreateQuery( > > > @"select new ItemRow( item.id, item.Description, bid.Amount ) > > > from Item item join item.Bids bid > > > where bid.Amount > 100" > > > ) > > > .List(); > > > foreach( ItemRow row in results ) { > > > // Do something > > > } > > > The custom ItemRow class doesn’t have to be a persistent class that > > > has it’s own mapping file, but in > > > order for NHibernate to “see” it, we need to import it using: > > > <hibernate-mapping> > > > <import class="ItemRow" /> > > > </hibernate-mapping> > > > ItemRow is therefore only a data-transfer class, useful in report > > > generation." > > > > > -- > > > > > You received this message because you are subscribed to the Google > Groups > > > "Fluent NHibernate" group. > > > To post to this group, send email to > [email protected]. > > > To unsubscribe from this group, send email to > > > [email protected]<fluent-nhibernate%[email protected]> > <fluent-nhibernate%[email protected]<fluent-nhibernate%[email protected]> > > > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/fluent-nhibernate?hl=en. > > -- > > You received this message because you are subscribed to the Google Groups > "Fluent NHibernate" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<fluent-nhibernate%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/fluent-nhibernate?hl=en. > > > -- You received this message because you are subscribed to the Google Groups "Fluent NHibernate" 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/fluent-nhibernate?hl=en.
