Quicoli
unread,May 27, 2011, 4:03:49 PM5/27/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ConfORM
Hi friends,
I'm using last version, and my mapping routine is like this:
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 (Categoria).Assembly.GetTypes().Where(t =>
(t.Namespace == typeof (Categoria).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.Cascade<Documento,
Indexacao>(Cascade.All.Include(Cascade.DeleteOrphans));
//this is returning a not null object, but this object is
empty, no mappings within it.
HbmMapping mappingDocument =
mapper.CompileMappingFor(baseEntities);
nhConfig.AddDeserializedMapping(mappingDocument,
"Classes");
if (salvarXml)
{
var arquivos =
mapper.CompileMappingForEach(baseEntities);
arquivos.WriteAllXmlMapping();
}
So, as CompileMappingForEach is not returning any mapping, no database
is updated :(
I cant figure out what is wrong here, because in another projetct,
doing same way, is ok.
Someone can point me out to right way?
thanks