another thing mapper.Customize<Photo>(x=> x.Property(photo=> photo.Path, map=> map.Length(255))) and ConfORM will apply the customization everywhere the component is used.
In your case even for the class Person you can use the 'Customize' instead the more specific 'Class'. Btw, Paulo, would be better if, stuff regarding ConfORM, were discussed in ConfORM google-group (I would avoid to boring no ConfORM users ;) ). On Thu, Jan 20, 2011 at 11:34 AM, Fabio Maulo <[email protected]> wrote: > By default, properties without a state (a field) are not persisted. > If you need a persistent read-only property (a sort of denormalization) you > have to explicitly declare it: > > orm.PersistentProperty<YourEntity>(ye => ye.YourReadOnly); > > > On Thu, Jan 20, 2011 at 9:49 AM, Paulo Quicoli <[email protected]>wrote: > >> Hi Friends! >> >> I'm facing something really weird. I did mapping of my classes, and ok, >> that worked out. Now I just included a new property - a read only one- in >> one class, but when I run my test, that new property is not created in my >> database! Also, in this same class I included a component class, but again >> it doesnt get mapped. conORM is always generating mapping in way before I >> had made changes. I'm showing some piece of my code: >> >> First, my read only property: >> >> public string PhoneticName >> { >> get >> >> >> { >> return Name != null ? Fonetico.Fonetiza(Name) : null; >> >> >> } >> } >> >> >> Now my mapping routine: >> >> var orm = new ObjectRelationalMapper(); >> >> >> >> var patternsAppliers = new SafePropertyAccessorPack(); >> patternsAppliers.Merge(new IdNamingApplier()); >> >> >> patternsAppliers.Merge(new CoolPatternsAppliersHolder(orm)); >> patternsAppliers.Merge(new OneToManyKeyColumnNamingApplier(orm)); >> >> >> patternsAppliers.Merge(new ManyToOneColumnNamingApplier()); >> >> >> var mapper = new Mapper(orm, patternsAppliers); >> >> >> IEnumerable<Type> baseEntities = >> typeof(Profissao).Assembly.GetTypes().Where(t => t.Namespace == >> typeof(Profissao).Namespace); >> >> >> orm.Patterns.Lists.Remove(orm.Patterns.Lists.Single(p => >> p.GetType() == typeof(ListCollectionPattern))); >> >> orm.Patterns.PoidStrategies.Add(new HighLowPoidPattern(new { >> max_lo = 100 })); >> >> orm.TablePerClass(baseEntities); >> >> mapper.Class<Person>(c => >> { >> c.Property(p => p.Name, pm => pm.Length(100)); >> >> >> c.Property(p=> p.PhoneticName, pm => >> pm.Access(Accessor.ReadOnly)); >> c.Component(p => p.Photo, cm => cm.Property(f => f.Path, fm >> => fm.Length(255))); >> >> >> }); >> >> HbmMapping mappingDocument = >> mapper.CompileMappingFor(baseEntities); >> nhConfig.AddDeserializedMapping(mappingDocument, "Domain"); >> >> >> >> >> >> -- >> Paulo Quicoli >> Editor Técnico: .NET Magazine, ClubeDelphi Magazine, WebMobile Magazine >> www.devmedia.com.br >> www.nhibernatebrasil.net >> http://pauloquicoli.spaces.live.com >> twitter:@pauloquicoli >> >> -- >> 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. >> > > > > -- > Fabio Maulo > > -- 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]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
