Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

ColumnPrefix only applied to first Component mapping inside a ComponentMap #261

Open
charlbrink opened this Issue Feb 24, 2014 · 3 comments

Comments

Projects
None yet
3 participants

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"

@chester89 chester89 added this to the Release 1.4.5.x milestone Feb 25, 2014

Collaborator

chester89 commented Feb 25, 2014

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

I am using 1.3.0.733 from NuGet.

Thanks.

On 25 February 2014 11:07, Gleb Chermennov notifications@github.com 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
.

I have the same issue in versions 1.3.0.733 and 1.4.0.0

@scardetto scardetto added a commit to scardetto/fluent-nhibernate that referenced this issue Jan 29, 2015

@scardetto scardetto Fixed issue #261
Added zero length string prefix to the stack to prevent it from being
reset after the first nested commit.
67d0686

@scardetto scardetto added a commit to scardetto/fluent-nhibernate that referenced this issue Jan 29, 2015

@scardetto scardetto Fixed issue #261
Added zero length string prefix to the stack to prevent it from being
reset after the first nested commit.
535e978

@chester89 chester89 added a commit to chester89/fluent-nhibernate that referenced this issue Jun 17, 2015

@scardetto @chester89 scardetto + chester89 Fixed issue #261
Added zero length string prefix to the stack to prevent it from being
reset after the first nested commit.
bfca6de
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment