I have situation like Employee.Store vs Store.Stuff in this sample:
http://wiki.fluentnhibernate.org/show/GettingStarted%3A+First+Project
. I use ClassMap<T> for my mappings like in the sample. I'd like to
use convention to set DB column name to Property.Name +
"Id" (resulting to EMPLOYEE.STOREID). When I specify just
IReferenceConvention like this:
public void Apply(IManyToOnePart target)
{
target.ColumnName(target.Property.Name + "Id");
}
the result is that the field is duplicated because the default
IHasManyConvention generates "Store_Id" field. So I have now in the
table "Store_Id" and "StoreId" both. How should I define the
IHasManyConvention? In this sample case it would work to define it
from generic collection parameter, but that's just because the
Employee.Store property name is same as the Store type name. I can't
find any solution how to build conventions when I don't have the
property name same as underlying type name. Like when I'd rename
Employee.Store Employee.ParentStore - how should I setup
IHasManyConvention when I want to map to "ParentStoreId" column name?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Fluent NHibernate" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---