Hi Jason, Thanks for the idea but NHibernate still attempts to insert a value but this time in the field instead of the property. I've also tried setting generated="always" but this is ignored.
Do you know if the property settings for composite-elements and classes are the same? Thanks, Keith On 17 Oct, 16:04, Jason Meckley <[EMAIL PROTECTED]> wrote: > just set the access attribute to nosetter.camelcase or whatever naming > strategy you use. > > On Oct 17, 10:19 am, Keith Bloom <[EMAIL PROTECTED]> wrote: > > > Hello, > > > Does anyone know if this: > > > <class name="Holiday" table="holidays"> > > // ... Some properties .. > > > <set name="Prices" table="Prices"> > > <composite-element class="Price"> > > <parent name="Holiday" /> > > <property name="Id" column="id" insert="false" update="true"/ > > > <property name="PricePerUnit" /> > > <property name="UnitsFrom" /> > > <property name="UnitTo" /> > > </composite-element> > > </set> > > </class> > > > or something along these lines, is possible? > > > The reason is I have a set of immutable prices in my model which is a > > combination of the price, units and the holiday. In the database the > > price row also gets a seeded Id. It would be very useful to have this > > as a read only property but if I add it to the Price class NHibernate > > kindly attempts to but a value in it. > > > As a workaround I'm using the HashCode as a identifier but this feels > > like a hack. > > > Many thanks, Keith. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to nhusers@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---