access="readonly"

   Diego


On Wed, Feb 17, 2010 at 12:50, Alex McMahon <[email protected]> wrote:

> Fabio,
>
> Thanks for your reply... I don't quite understand what you mean... I
> think you're saying "how can NH know that it needs to put something in
> the DB if you don't tell it to". I see what you're saying
> (particularly as it's not just a default canned value that needs to go
> in). I guess what I want is to be able to map a property that has a
> getter only by specifying an access strategy that results in the
> property just being persisted to the database on an insert but doesn't
> try to set the property from the DB on a read...
>
> Thanks
>
> On Feb 17, 3:35 pm, Fabio Maulo <[email protected]> wrote:
> > Have you an idea about from where NH can know/read to write in the FK ?
> >
> > 2010/2/17 Alex McMahon <[email protected]>
> >
> >
> >
> > > I have a legacy database that I'm restricted from changing. I have 2
> > > related tables that both have a foreign key to the same 3rd table. In
> > > my application I'd rather not have this relationship repeated on both
> > > classes. But when I don't map this relationship for both classes I get
> > > problems as NHibernate does not put the foreign key in the database.
> >
> > > I'd like it to be like this:
> > > TableA:
> > > TableBId
> > > TableCId
> > > (other fields)
> >
> > > TableB:
> > > TableCId
> >
> > > -----
> >
> > > ClassA:
> > > ClassB B
> > > ClassC C
> >
> > > ClassB:
> > > (other fields)
> > > //I don't want ClassC referenced here.
> >
> > > Any idea how I can tell NHibernate to write the foreign key for TableB-
> > > >TableC on an insert, with the minimal amount of pollution of my
> > > domain model.
> >
> > > --
> > > 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]>
> <nhusers%[email protected]<nhusers%[email protected]>
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/nhusers?hl=en.
> >
> > --
> > Fabio Maulo
>
> --
> 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