You're missing a call to Configure. Before calling modeloPersistencia. WriteMappingsTo(@"d:\"); call modeloPersistencia.Configure(nhibernateConfig); On Thu, Jan 8, 2009 at 9:57 PM, Luis Abreu <lab...@gmail.com> wrote:
> Btw James, one more question: > > > > When using the auto persistence, shouldn't I be able to save the xml to > disk by using the previous code? It's that I get nothing and stopping the > debugger there I see 0 mappings on the persistencemodel > > > > Thanks. > > > > > > --- > > Luis Abreu > > > > *From:* fluent-nhibernate@googlegroups.com [mailto: > fluent-nhibern...@googlegroups.com] *On Behalf Of *James Gregory > *Sent:* quinta-feira, 8 de Janeiro de 2009 16:27 > *To:* fluent-nhibernate@googlegroups.com > *Subject:* [fluent-nhib] Re: question on auto mapping > > > > Hello Luis, > > > > I'm away from a machine with Visual Studio on right now, so I don't know > how much help I can be, but lets try to work through your problem. > > > > Firstly, why is it that you're using a IUserType for your version? What is > the type that your version property has in your entity? I ask that because > Fluent NHibernate has a few options for mapping Versions and Timestamps. > > - If you call your property Timestamp and give it a type of TimeSpan, > Fluent NHibernate will automatically map that to a Timestamp. > - If you call your property Version, and give it a type of int or long, > then it will map it as a Version. > > Are any of those possible options for you? > > > > On Thu, Jan 8, 2009 at 3:40 PM, Luis Abreu <lab...@gmail.com> wrote: > > > Btw, one more stupid question. If I have this: > > > var modeloPersistencia = > AutoPersistenceModel.MapEntitiesFromAssemblyOf<Disciplina>() > .Where( > type => type == typeof (Disciplina) > ) //comecar com disciplina > .WithConvention(convention => > { > convention.DefaultLazyLoad = false; > convention.FindIdentity = field => > field.Name == "Id"; > convention.GetTableName = type => > String.Concat(type.Name, "s"); > convention.GetVersionColumnName = > type => "Versao"; > convention.GetPrimaryKeyNameFromType > = type => String.Concat("Id", type.Name); > convention.IsBaseType = type => type > == typeof (EntidadeBase); > }); > > modeloPersistencia.WriteMappingsTo(@"d:\"); > > Shouldn't I get the xml mapping file for class Disciplina on d:? I've tried > and I get nothing there (interestingly, if I add the > modeloPersistencia.ForTypesThatDeriveFro<EntidadeBase> method call then I > do > get the xml for EntidadeBase only (which I don't want)... > > Thanks. > > > > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-nhibernate@googlegroups.com To unsubscribe from this group, send email to fluent-nhibernate+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en -~----------~----~----~----~------~----~------~--~---