aozora
unread,Jan 3, 2012, 4:18:06 AM1/3/12Sign 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 codec...@googlegroups.com
Something strange happened, this is how I configure ConfORM:
var orm = new ObjectRelationalMapper();
var patternSet = new CoolPatternsAppliersHolder(orm);
var mapper = new Mapper(orm, patternSet);
// Set Id generation to HiLo
orm.Patterns.PoidStrategies.Add(new HighLowPoidPattern(/*new { max_lo = 100 }*/));
// map .NET4 ISet<T> as a NHibernate's set
orm.Patterns.Sets.Add(mi => mi.GetPropertyOrFieldType().GetGenericIntercafesTypeDefinitions().Contains(typeof(ISet<>)));
orm.Patterns.Sets.Add(new UseSetWhenGenericCollectionPattern());
mapper.PatternsAppliers.Merge(new SafePropertyAccessorPack());
mapper.PatternsAppliers.Merge(new OneToOneRelationPack(orm));
mapper.PatternsAppliers.Merge(new OneToManyKeyColumnApplier(orm));
mapper.PatternsAppliers.Merge(new BidirectionalManyToManyRelationPack(orm));
mapper.PatternsAppliers.Merge(new BidirectionalOneToManyRelationPack(orm));
mapper.PatternsAppliers.Merge(new CoolTablesAndColumnsNamingPack(orm));
mapper.PatternsAppliers.Merge(new Arashi.Core.NHibernate.ConfOrm.PoidColumnNameApplier());
mapper.PatternsAppliers.Merge(new TablePerClassPack());
mapper.PatternsAppliers.Merge(new PluralizedTablesPack(orm, new EnglishInflector()));
Initially all went well, and the generated hbm mapping was perfect, than after I wrote some mapper.Customize<> for some entities, I saw that in the mappings there wasn't anymore any table="xxx" for each class, as the PluralizedTablesPack wasn't working any more.
I tryied to comment out all the mapper.Customize<>, but this don't change anything, ConfORM will not generate anymore any table pluralized in the mappings.
this is the mapping for a simple entity:
<class name="Widget">
<id name="Id" column="WidgetId" type="Int32">
<generator class="hilo" />
</id>
<many-to-one name="Type" column="WidgetTypeId" not-null="true" />
<many-to-one name="Site" column="SiteId" not-null="true" />
<property name="Title" />
<property name="PlaceHolder" />
<property name="Position" />
<map name="Settings" table="WidgetSettings" cascade="all">
<cache usage="read-write" />
<key column="WidgetId" />
<map-key type="String" />
<element column="Value" type="String" />
</map>
</class>
Any ideas please?