This is how I did it a while ago, while exploring the options from AR,
but the test shows the same number of selects.
Probably I'll go with the Fábio's solution.
On Nov 5, 10:59 pm, Roelof Blom <
roelof.b...@gmail.com> wrote:
> How about this?
>
> [ActiveRecord( SelectBeforeUpdate=true, DynamicInsert = true, DynamicUpdate
> = true)]
> public class News : BusinessObject<News>
> {
> // all properties here, except content
>
> *[Lazy=FetchWhen.OnInvoke]*
> public NewsContent Content { get;set;}
>
> }
>
> 2009/11/5 Fábio Batista <
fabio.david.bati...@gmail.com>
>
>
>
> > Tip: you'll need to save your News entity prior to calling
> > CreateContent(), or else you'll not get the correct Id. I usually
> > throw an exception in case I try to call CreateContent() and the Id ==
> > 0.
>
> > I'm sure there's a more elegant way out there, though...
>
> > Fábio David Batista
> >
fabio.david.bati...@gmail.com
> >
http://nerd-o-matic.blogspot.com
>
> > 2009/11/5 Fábio Batista <
fabio.david.bati...@gmail.com>:
> > > Here is what I usually do:
>
> > >
http://dblendea.pastebin.com/f2c192a48
>
> > > There's a little more code, but it's simple enough and makes you feel
> > > in control.
>
> > > Fábio David Batista
> > >
fabio.david.bati...@gmail.com
> > >
http://nerd-o-matic.blogspot.com
>
> > > On Thu, Nov 5, 2009 at 4:16 PM, Ricardo Lopes <
rjlo...@gmail.com> wrote:
>
> >
http://docs.jboss.org/hibernate/core/3.3/reference/en/html/performanc...
> > >> The NHibernate 2.1 is comparable to Hibernate 3.2.6 so it should works,
> > I
> > >> just don't know how.
> > >> I doubt there is support for this using ActiveRecord, the alternative is
> > to
> > >> use a projection in HQL or using a criteria.
> > >> Hope that helps.
> > >> 2009/11/5 bdaniel7 <
bdani...@gmail.com>