fluent-nhibernate icon indicating copy to clipboard operation
fluent-nhibernate copied to clipboard

ColumnPrefix only applied to first Component mapping inside a ComponentMap

Open charlbrink opened this issue 11 years ago • 3 comments

When nesting Components, the ColumnPrefix is only applied to the first nested Component.

Example Mapping follows: ClassMap

Component(x => x.Invoice).ColumnPrefix("Invoice");

and

public class InvoiceMap : ComponentMap<Invoice>
{
  public InvoiceMap()
  {
        Map(x => x.Guid);
        Component<Text>(x => x.IssueLocation, n =>
        {
            n.Map(x => x.Content).Column("IssueLocation");
            n.Component<Code>(x => x.Language, c =>
            {
                c.Map(x => x.CodeListGuid).Column("IssueLocationLanguageCodeList");
                c.Map(x => x.Content).Column("IssueLocationLanguageContent").Length(2);
            });
        });
        Component<Text>(x => x.AuthenticationLocationName, n =>
        {
            n.Map(x => x.Content).Column("AuthLocationName");
            n.Component<Code>(x => x.Language, c =>
            {
                c.Map(x => x.CodeListGuid).Column("AuthLocationNameLanguageCodeList");
                c.Map(x => x.Content).Column("AuthLocationNameLanguage").Length(2);
            });
        });

The mapping above will result in database table column names: InvoiceGuid InvoiceIssueLocation InvoiceIssueLocationLanguageCodeList InvoiceIssueLocationLanguageContent AuthLocationName AuthLocationNameLanguageCodeList AuthLocationNameLanguage

AuthLocationName* should also be prefixed with "Invoice"

charlbrink avatar Feb 24 '14 15:02 charlbrink

Ok, let me look into that. What version are you using? Is it 1.4.0.0 from NuGet?

chester89 avatar Feb 25 '14 09:02 chester89

I am using 1.3.0.733 from NuGet.

Thanks.

On 25 February 2014 11:07, Gleb Chermennov [email protected] wrote:

Ok, let me look into that. What version are you using? Is it 1.4.0.0 from NuGet?

— Reply to this email directly or view it on GitHubhttps://github.com/jagregory/fluent-nhibernate/issues/261#issuecomment-35987961 .

charlbrink avatar Feb 25 '14 12:02 charlbrink

I have the same issue in versions 1.3.0.733 and 1.4.0.0

Tradioyes avatar May 23 '14 11:05 Tradioyes