ok, I have difficult time with automapping collections using fluent nhibernate. This time I tried to apply a collection convention which simply says to use camelCaseField with underscore. Well I got the convention loaded and I hit the breakpoint in the method below FNH still produces strange mapping. What I am doing wrong?
public class Parent
{
public virtual int Id { get; set; }
private IList<Child> _testCollection;
public virtual IList<Child> TestCollection
{
get
{
return _testCollection;
}
}
}
public class Child
{
public virtual int Id { get; set; }
}
public class CollectionAccessConvention : ICollectionConvention
{
public void Apply( ICollectionInstance instance )
{
instance.Access.CamelCaseField( CamelCasePrefix.Underscore );
}
}
<class xmlns="urn:nhibernate-mapping-2.2" mutable="true" name="Test.Parent, Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" table="`Parent`">
<id name="Id" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<column name="Id" />
<generator class="identity" />
</id>
<bag access="nosetter.camelcase" name="TestCollection" mutable="true">
<key>
<column name="Parent_id" />
</key>
<one-to-many class="Test.Child, Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</bag>
EDIT: @Bary: the strange thing is access="nosetter.camelcase". I think it should be access="field.camelcase-underscore". Any suggestions?