Hi James He needs to map it to a timestamp, which is where I get lost as you need to use IUserType to make that work which I have no idea how to use.
Thanks for helping, I think you know how that all works better than myself. Andy On Thu, Jan 8, 2009 at 4:27 PM, James Gregory <jagregory....@gmail.com>wrote: > 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. >> >> >> >> >> > > > > -- ================= I-nnovate Software - Bespoke Software Development, uk wirral. http://www.i-nnovate.net --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---