[fluent-nhib] Re: Component ColumnPrefix is broken in 1.2.0.712 (for NH3)
Ah, that makes sense (though is obviously a bug). Conventions shouldn't be descructive, but columns have always been a bit of a weird edge case. This kind of thing is on my list of things to sort out once and for all, but for the time being I can fix this one case. -- You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To view this discussion on the web visit https://groups.google.com/d/msg/fluent-nhibernate/-/4nrGcERCVJQJ. To post to this group, send email to fluent-nhibernate@googlegroups.com. To unsubscribe from this group, send email to fluent-nhibernate+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en.
[fluent-nhib] Re: Component ColumnPrefix is broken in 1.2.0.712 (for NH3)
Updated my answer on stackoverflow if anyone is interested: http://stackoverflow.com/questions/6287698/fluentnhibernate-component-columnprefix-not-being-applied Thanks, Brian On Jul 22, 2:24 am, Brian Chavez wrote: > Actually, I think I've found *my* problem. > > After investigating the unit tests in the source code; it appears > that, in my case, my conventions were being applied differently > between FNH v1.1 and FNH v1.2. > > My ColumnPrefix() call in the my property component mapping somehow > conflicted with IPropertyConvention calls that made > instance.Column("someName") calls. > > I think what happened is this: > > 1. My ComponentMap would get executed. No problem here. > > 2. My ClassMap would Component(x => > class.Property).ColumnPrefix("FOO") from Step 1. > > 3. My IPropertyConvention class would call > (IPropertyInstance)instance.Column( instance.Name ) > > It looks like: > * in FNH 1.1, Step 3 is not destructive to the column prefix when > calling instance.Column(""). > * in FNH 1.2, Step 3 is destructive to any ColumnPrefix() previously > set and over-writes the *entire* column name (including the prefix). > > I cleaned up my conventions for FNH 1.2 using > IPropertyConventionAcceptance to be careful not to blindly call > instance.Column(instance.Name) [now that calls are destructive to > column prefixes]. > > -Brian > > On Jul 21, 9:02 pm, "Alexander I. Zaytsev" wrote: > > > > > > > > > Yes it is. -- You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-nhibernate@googlegroups.com. To unsubscribe from this group, send email to fluent-nhibernate+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en.
[fluent-nhib] Re: Component ColumnPrefix is broken in 1.2.0.712 (for NH3)
Actually, I think I've found *my* problem. After investigating the unit tests in the source code; it appears that, in my case, my conventions were being applied differently between FNH v1.1 and FNH v1.2. My ColumnPrefix() call in the my property component mapping somehow conflicted with IPropertyConvention calls that made instance.Column("someName") calls. I think what happened is this: 1. My ComponentMap would get executed. No problem here. 2. My ClassMap would Component(x => class.Property).ColumnPrefix("FOO") from Step 1. 3. My IPropertyConvention class would call (IPropertyInstance)instance.Column( instance.Name ) It looks like: * in FNH 1.1, Step 3 is not destructive to the column prefix when calling instance.Column(""). * in FNH 1.2, Step 3 is destructive to any ColumnPrefix() previously set and over-writes the *entire* column name (including the prefix). I cleaned up my conventions for FNH 1.2 using IPropertyConventionAcceptance to be careful not to blindly call instance.Column(instance.Name) [now that calls are destructive to column prefixes]. -Brian On Jul 21, 9:02 pm, "Alexander I. Zaytsev" wrote: > Yes it is. -- You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-nhibernate@googlegroups.com. To unsubscribe from this group, send email to fluent-nhibernate+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en.
[fluent-nhib] Re: Component ColumnPrefix is broken in 1.2.0.712 (for NH3)
Yes it is. -- You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To view this discussion on the web visit https://groups.google.com/d/msg/fluent-nhibernate/-/YlHOchl10MEJ. To post to this group, send email to fluent-nhibernate@googlegroups.com. To unsubscribe from this group, send email to fluent-nhibernate+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en.
[fluent-nhib] Re: Component ColumnPrefix is broken in 1.2.0.712 (for NH3)
Alexander, does that test fail? If so, I'll add it to the test suite. -- You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To view this discussion on the web visit https://groups.google.com/d/msg/fluent-nhibernate/-/eQvntwhdWLYJ. To post to this group, send email to fluent-nhibernate@googlegroups.com. To unsubscribe from this group, send email to fluent-nhibernate+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en.
[fluent-nhib] Re: Component ColumnPrefix is broken in 1.2.0.712 (for NH3)
For me it is not working to. I have the PropertyConvention: class CustomColumnNameConvention : IPropertyConvention { public void Apply(IPropertyInstance instance) { instance.Column(instance.Name.ToUpper()); } } and I've following test down: [Test] public void ComponentPropertiesAssumeComponentColumnPrefixWithPropertyConvention() { var autoMapper = AutoMap.Source(source, addressCfg) .Conventions.Add(); new AutoMappingTester(autoMapper) .Element("class/component[@name='WorkAddress']/property[@name='Number']/column").HasAttribute("name", "WorkAddress_NUMBER"); } Tests added into AutoPersistenceModelComponentTests -- You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To view this discussion on the web visit https://groups.google.com/d/msg/fluent-nhibernate/-/iAgRjXfPe9MJ. To post to this group, send email to fluent-nhibernate@googlegroups.com. To unsubscribe from this group, send email to fluent-nhibernate+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en.
[fluent-nhib] Re: Component ColumnPrefix is broken in 1.2.0.712 (for NH3)
CONFIRMED, now 2 people confirming this bug http://stackoverflow.com/questions/6287698/fluentnhibernate-component-columnprefix-not-being-applied/6727557 Thanks, Brian On Jul 16, 2:11 pm, Brian Chavez wrote: > *bump* > > Component( x => x.Property).ColumnPrefix("MyPrefix") is seriously > broken. > > http://stackoverflow.com/questions/6287698/fluentnhibernate-component... > > Also, I'm using the 1.2.0.712 binary directly from FNH website (not > NuGet). -- You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-nhibernate@googlegroups.com. To unsubscribe from this group, send email to fluent-nhibernate+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en.