Re: [nhusers] Re: Write only property for legacy database

2010-02-18 Thread Fabio Maulo
eh? 2010/2/18 Diego Mijelshon > Beat you to it by 12 minutes. And I'm beggining to use your style, too. > I'm worried :-) > >Diego > > > 2010/2/17 Fabio Maulo > >> access="readonly" >> >> 2010/2/17 Alex McMahon >> >> Fabio, >>> >>> Thanks for your reply... I don't quite understand what you

Re: [nhusers] Re: Write only property for legacy database

2010-02-18 Thread Diego Mijelshon
Not sure about FNH, but using hbm mappings you don't need a setter if you declare a property with access="readonly". NH will keep track of the DB value, do dirty checks with it and issue the appropriate updates to the DB. Diego P.S. I'm writing this offline, sorry if somebody already answered

Re: [nhusers] Re: Write only property for legacy database

2010-02-18 Thread Diego Mijelshon
Beat you to it by 12 minutes. And I'm beggining to use your style, too. I'm worried :-) Diego 2010/2/17 Fabio Maulo > access="readonly" > > 2010/2/17 Alex McMahon > > Fabio, >> >> Thanks for your reply... I don't quite understand what you mean... I >> think you're saying "how can NH know t

Re: [nhusers] Re: Write only property for legacy database

2010-02-18 Thread Fabio Maulo
You have another option if FNH does not support access="readonly". Ask the feature to FNH team ;) 2010/2/18 Robert Rudduck > You could set the access to use a private field and not put a setter on the > property. ReadOnly means that any update wont be written out, but it still > requires a sette

Re: [nhusers] Re: Write only property for legacy database

2010-02-18 Thread Robert Rudduck
You could set the access to use a private field and not put a setter on the property. ReadOnly means that any update wont be written out, but it still requires a setter of some sort so NHibernate can initialize it. On Thu, Feb 18, 2010 at 2:12 AM, Alex McMahon wrote: > Intereting... I know this

[nhusers] Re: Write only property for legacy database

2010-02-18 Thread Alex McMahon
Intereting... I know this is sort of the wrong place to ask, but how do I do this in Fluent NH? I've tried .ReadOnly() but I then get an error message about there not being a setter... I've also tried. Access. but there doesn't seem to be one called ReadOnly... any ideas? On Feb 17, 11:29 pm, Fabi

Re: [nhusers] Re: Write only property for legacy database

2010-02-17 Thread Fabio Maulo
access="readonly" 2010/2/17 Alex McMahon > 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 defau

Re: [nhusers] Re: Write only property for legacy database

2010-02-17 Thread Diego Mijelshon
access="readonly" Diego On Wed, Feb 17, 2010 at 12:50, Alex McMahon 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 >

[nhusers] Re: Write only property for legacy database

2010-02-17 Thread Alex McMahon
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 wa

[nhusers] Re: Write only property for legacy database

2010-02-17 Thread Alex McMahon
Robert, Thanks, yes this is one solution I've arrived at, I've got a protected property that I map for NH that is just a getter. ClassB: ClassA A; protected virtual long ClassCId{ get{ return A.ClassC.Id }set{ } } I just thought I'd see if there was a better way someone could suggest On Feb 17,