Fixed
Details
Details
Assignee
Unassigned
UnassignedReporter
Andrew Shepherd
Andrew ShepherdLabels
Components
Fix versions
Affects versions
Priority
Who's Looking?
Open Who's Looking?
Created October 19, 2016 at 9:43 PM
Updated July 10, 2017 at 4:43 PM
Resolved March 1, 2017 at 3:00 AM
My entity holds a component, and this component has a bag of child components.
My child component has a property, the name of which differs from the corresponding database column.
I explicitly set the database column name, but this is ignored. It attempts to access the data using the class's property name, not the column name.
Here is the actual bag mapping code. I have a property called "Address" which is supposed to map to the "EmailAddress" column. The nHIbernate code would attempt to use a column with the name of "Address"
componentMapper.Bag(mc => mc.Recipients,
bagPropertyMapper =>
{
bagPropertyMapper.Table("CompanyMailRecipient");
bagPropertyMapper.Key(mrKeyMapper =>
{
mrKeyMapper.Column("Company_Id");
});
},
r => r.Component(
mrc =>
{
mrc.Property
(
mr => mr.Name,
mrpm => mrpm.Column("Name")
);
/*****************************/
/* Here's the important bit */
/*****************************/
mrc.Property
(
mr => mr.Address,
mrpm => mrpm.Column("EmailAddress");
);
mrc.Property
(
mr => mr.DestinationType,
mrpm => mrpm.Column("DestinationType")
);
};
)