Hi, http://nhforge.org/doc/nh/en/index.html#mapping-declaration-manytoone - have you tried setting update="false" on many-to-one?
On Tuesday, 27 November 2012 13:54:21 UTC+1, Michael Holdgaard wrote: > > Hi > > I have the following entities (in pseudo-code) in an "old" legacy system: > > class Case > int id; > int addressId; > Address address; > > class Address > int id; > string streetname; > string streetnumber; > > The NHibernate mapping looks like this: > > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace= ..... > > <class name="Case" table="Cases" lazy="false"> > <id name="Id"> > <generator class="identity"/> > </id> > <many-to-one cascade="all-delete-orphan" name="address" column="A > ddressId" class="Address"/> > </class> > </hibernate-mapping> > > When the Case is updated, the associated address will also be updated - > but the behaviour should be, that the address should never be updated (as > this is done somewhere else by a manager). So my question is - how can I > make this relation *readonly*? > > Thanks in advance > > /Michael > > > > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/8xmrgPMA66MJ. 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.
