Id Column Name Not Mapping
I have an override class that looks like this:
public class CarrierMap : IAutoMappingOverride<Carrier>
{
public void Override(AutoMapping<Carrier> mapping)
{
mapping.Table("PFS_CARRIERS_011");
mapping.Id(x => x.Id, "CARRIER_CODE")
.GeneratedBy.Assigned();
. . .
}
}
The generated XML looks like this:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-access="property" auto-import="true" default-cascade="none" default-lazy="true">
<id name="Id" type="System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<column name="Id" />
<generator class="assigned" />
</id>
. . . </hibernate-mapping>
I know the override is working properly because the table name is getting mapped properly. However, the column name for the Id is being mapped as Id and not as CARRIER_CODE as I've specified in the override.
Is this a bug, or am I missing something?
2 Posted by Jeff Barriault on 03 Sep, 2010 06:27 PM
I've managed to do some more testing on this. My complete override class looks like this:
namespace iPFSv2.Data.NHibernateMaps
{
}
The complete generated mapping file looks like this:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-access="property" auto-import="true" default-cascade="none" default-lazy="true">
</hibernate-mapping>
I've even gone as far as adding a specific override to my AutoPersistenceModel generator like this:
I have no idea why the Id element ends up with name="Id" and column name="Id" instead of CARRIER_CODE as I've specified in the CarrierMap override class AND specifically in my fluent mapping by using Override.
Anyone see anything wrong with my code, or is this a bug? By the way, my DLL was compiled from the 1.1 version available as a zip file from the download page.