diff --git a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsClassTests.cs b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsClassTests.cs index f6904f225..bce9f15d5 100644 --- a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsClassTests.cs +++ b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsClassTests.cs @@ -117,7 +117,7 @@ public void TableShouldntBeOverwritten() private void Convention(Action convention) { - model.ConventionFinder.Add(new ClassConventionBuilder().Always(convention)); + model.Conventions.Add(new ClassConventionBuilder().Always(convention)); } private void Mapping(Action> mappingDefinition) diff --git a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsComponentTests.cs b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsComponentTests.cs index 4529c1455..7334e944f 100644 --- a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsComponentTests.cs +++ b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsComponentTests.cs @@ -76,7 +76,7 @@ public void OptimisticLockShouldntBeOverwritten() private void Convention(Action convention) { - model.ConventionFinder.Add(new ComponentConventionBuilder().Always(convention)); + model.Conventions.Add(new ComponentConventionBuilder().Always(convention)); } private void Mapping(Action> mappingDefinition) diff --git a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsDynamicComponentTests.cs b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsDynamicComponentTests.cs index 5fa4818e9..ba4fceda9 100644 --- a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsDynamicComponentTests.cs +++ b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsDynamicComponentTests.cs @@ -77,7 +77,7 @@ public void OptimisticLockShouldntBeOverwritten() private void Convention(Action convention) { - model.ConventionFinder.Add(new DynamicComponentConventionBuilder().Always(convention)); + model.Conventions.Add(new DynamicComponentConventionBuilder().Always(convention)); } private void Mapping(Action> mappingDefinition) diff --git a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsHasManyCollectionTests.cs b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsHasManyCollectionTests.cs index 6a5f87f57..1ad5e493e 100644 --- a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsHasManyCollectionTests.cs +++ b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsHasManyCollectionTests.cs @@ -201,7 +201,7 @@ public void TableNameShouldntBeOverwritten() private void Convention(Action convention) { - model.ConventionFinder.Add(new CollectionConventionBuilder().Always(convention)); + model.Conventions.Add(new CollectionConventionBuilder().Always(convention)); } private void Mapping(Expression>> property, Action> mappingDefinition) diff --git a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsHasManyTests.cs b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsHasManyTests.cs index a6bb6ad7a..52079e9a1 100644 --- a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsHasManyTests.cs +++ b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsHasManyTests.cs @@ -210,7 +210,7 @@ public void NotFoundShouldntBeOverwritten() private void Convention(Action convention) { - model.ConventionFinder.Add(new OneToManyCollectionConventionBuilder().Always(convention)); + model.Conventions.Add(new OneToManyCollectionConventionBuilder().Always(convention)); } private void Mapping(Expression>> property, Action> mappingDefinition) diff --git a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsHasManyToManyCollectionTests.cs b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsHasManyToManyCollectionTests.cs index c160c3a12..e994e128b 100644 --- a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsHasManyToManyCollectionTests.cs +++ b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsHasManyToManyCollectionTests.cs @@ -191,7 +191,7 @@ public void TableNameShouldntBeOverwritten() private void Convention(Action convention) { - model.ConventionFinder.Add(new CollectionConventionBuilder().Always(convention)); + model.Conventions.Add(new CollectionConventionBuilder().Always(convention)); } private void Mapping(Expression>> property, Action> mappingDefinition) diff --git a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsHasManyToManyTests.cs b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsHasManyToManyTests.cs index 65bcc762f..634f87f81 100644 --- a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsHasManyToManyTests.cs +++ b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsHasManyToManyTests.cs @@ -200,7 +200,7 @@ public void TableNameShouldntBeOverwritten() private void Convention(Action convention) { - model.ConventionFinder.Add(new ManyToManyCollectionConventionBuilder().Always(convention)); + model.Conventions.Add(new ManyToManyCollectionConventionBuilder().Always(convention)); } private void Mapping(Expression>> property, Action> mappingDefinition) diff --git a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsHasOneTests.cs b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsHasOneTests.cs index 9d145b1f2..c9593adec 100644 --- a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsHasOneTests.cs +++ b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsHasOneTests.cs @@ -109,7 +109,7 @@ public void PropertyRefShouldntBeOverwritten() private void Convention(Action convention) { - model.ConventionFinder.Add(new HasOneConventionBuilder().Always(convention)); + model.Conventions.Add(new HasOneConventionBuilder().Always(convention)); } private void Mapping(Action> mappingDefinition) diff --git a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsIdTests.cs b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsIdTests.cs index 46cc95ab4..e9ff4e709 100644 --- a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsIdTests.cs +++ b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsIdTests.cs @@ -79,7 +79,7 @@ public void LengthValueShouldntBeOverwritten() private void Convention(Action convention) { - model.ConventionFinder.Add(new IdConventionBuilder().Always(convention)); + model.Conventions.Add(new IdConventionBuilder().Always(convention)); } private void Mapping(Expression> property, Action mappingDefinition) diff --git a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsJoinedSubclassTests.cs b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsJoinedSubclassTests.cs index b44393b77..b05fc729f 100644 --- a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsJoinedSubclassTests.cs +++ b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsJoinedSubclassTests.cs @@ -117,7 +117,7 @@ public void TableNameShouldntBeOverwritten() private void Convention(Action convention) { - model.ConventionFinder.Add(new JoinedSubclassConventionBuilder().Always(convention)); + model.Conventions.Add(new JoinedSubclassConventionBuilder().Always(convention)); } private void Mapping(Action> mappingDefinition) diff --git a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsManyToOneTests.cs b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsManyToOneTests.cs index 3fa9e9936..70931511d 100644 --- a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsManyToOneTests.cs +++ b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsManyToOneTests.cs @@ -192,7 +192,7 @@ public void ForeignKeyShouldntBeOverwritten() private void Convention(Action convention) { - model.ConventionFinder.Add(new ReferenceConventionBuilder().Always(convention)); + model.Conventions.Add(new ReferenceConventionBuilder().Always(convention)); } private void Mapping(Action> mappingDefinition) diff --git a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsPropertyTests.cs b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsPropertyTests.cs index 2459dad64..22021ef5f 100644 --- a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsPropertyTests.cs +++ b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsPropertyTests.cs @@ -247,7 +247,7 @@ public void DefaultShouldntBeOverwritten() private void Convention(Action convention) { - model.ConventionFinder.Add(new PropertyConventionBuilder().Always(convention)); + model.Conventions.Add(new PropertyConventionBuilder().Always(convention)); } private void Mapping(Expression> property, Action mappingDefinition) diff --git a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsSubclassTests.cs b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsSubclassTests.cs index 52d28dcea..cfdd7e84c 100644 --- a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsSubclassTests.cs +++ b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsSubclassTests.cs @@ -87,7 +87,7 @@ public void SelectBeforeUpdateShouldntBeOverwritten() private void Convention(Action convention) { - model.ConventionFinder.Add(new SubclassConventionBuilder().Always(convention)); + model.Conventions.Add(new SubclassConventionBuilder().Always(convention)); } private void Mapping(Action> mappingDefinition) diff --git a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsVersionTests.cs b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsVersionTests.cs index 967065e52..3da4fed5a 100644 --- a/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsVersionTests.cs +++ b/src/FluentNHibernate.Testing/ConventionsTests/FluentInterfaceOverridingConventionsVersionTests.cs @@ -69,7 +69,7 @@ public void UnsavedValueShouldntBeOverwritten() private void Convention(Action convention) { - model.ConventionFinder.Add(new VersionConventionBuilder().Always(convention)); + model.Conventions.Add(new VersionConventionBuilder().Always(convention)); } private void Mapping(Expression> property, Action mappingDefinition) diff --git a/src/FluentNHibernate.Testing/DomainModel/Mapping/MappingTester.cs b/src/FluentNHibernate.Testing/DomainModel/Mapping/MappingTester.cs index f7849dfbf..ed8f2550b 100644 --- a/src/FluentNHibernate.Testing/DomainModel/Mapping/MappingTester.cs +++ b/src/FluentNHibernate.Testing/DomainModel/Mapping/MappingTester.cs @@ -38,7 +38,7 @@ public virtual MappingTester RootElement public virtual MappingTester Conventions(Action conventionFinderAction) { - conventionFinderAction(model.ConventionFinder); + conventionFinderAction(model.Conventions); return this; } diff --git a/src/FluentNHibernate/AutoMap/AutoPersistenceModel.cs b/src/FluentNHibernate/AutoMap/AutoPersistenceModel.cs index df55a9447..ebbbdae44 100644 --- a/src/FluentNHibernate/AutoMap/AutoPersistenceModel.cs +++ b/src/FluentNHibernate/AutoMap/AutoPersistenceModel.cs @@ -49,7 +49,7 @@ public AutoPersistenceModel UseOverridesFromAssemblyOf() /// public new SetupConventionFinder ConventionFinder { - get { return new SetupConventionFinder(this, base.ConventionFinder); } + get { return new SetupConventionFinder(this, base.Conventions); } } /// diff --git a/src/FluentNHibernate/Cfg/FluentMappingsContainer.cs b/src/FluentNHibernate/Cfg/FluentMappingsContainer.cs index 2a53b4e77..a3abba9cf 100644 --- a/src/FluentNHibernate/Cfg/FluentMappingsContainer.cs +++ b/src/FluentNHibernate/Cfg/FluentMappingsContainer.cs @@ -88,7 +88,7 @@ public FluentMappingsContainer ExportTo(string path) /// public SetupConventionFinder ConventionDiscovery { - get { return new SetupConventionFinder(this, model.ConventionFinder); } + get { return new SetupConventionFinder(this, model.Conventions); } } /// diff --git a/src/FluentNHibernate/Mapping/ClassMap.cs b/src/FluentNHibernate/Mapping/ClassMap.cs index 1a9da865b..60e2bef3f 100644 --- a/src/FluentNHibernate/Mapping/ClassMap.cs +++ b/src/FluentNHibernate/Mapping/ClassMap.cs @@ -195,6 +195,7 @@ public virtual IdentityPart Id(Expression> expression, string co return part; } + [Obsolete("Inline definitions of subclasses are depreciated. Please create a derived class from SubclassMap in the same way you do with ClassMap.")] public virtual void JoinedSubClass(string keyColumn, Action> action) where TSubclass : T { var subclass = new JoinedSubClassPart(keyColumn); diff --git a/src/FluentNHibernate/Mapping/DiscriminatorPart.cs b/src/FluentNHibernate/Mapping/DiscriminatorPart.cs index 24fa73ed9..b60eeec2e 100644 --- a/src/FluentNHibernate/Mapping/DiscriminatorPart.cs +++ b/src/FluentNHibernate/Mapping/DiscriminatorPart.cs @@ -29,6 +29,7 @@ DiscriminatorMapping IDiscriminatorMappingProvider.GetDiscriminatorMapping() return mapping; } + [Obsolete("Inline definitions of subclasses are depreciated. Please create a derived class from SubclassMap in the same way you do with ClassMap.")] public DiscriminatorPart SubClass(object discriminatorValue, Action> action) { var subclass = new SubClassPart(this, discriminatorValue); @@ -39,6 +40,7 @@ public DiscriminatorPart SubClass(object discriminatorValue, Action(Action> action) { return SubClass(null, action); diff --git a/src/FluentNHibernate/PersistenceModel.cs b/src/FluentNHibernate/PersistenceModel.cs index 26c3ce17a..390919086 100644 --- a/src/FluentNHibernate/PersistenceModel.cs +++ b/src/FluentNHibernate/PersistenceModel.cs @@ -21,16 +21,16 @@ public class PersistenceModel protected readonly IList classProviders = new List(); protected readonly IList subclassProviders = new List(); private readonly IList visitors = new List(); - public IConventionFinder ConventionFinder { get; private set; } + public IConventionFinder Conventions { get; private set; } public bool MergeMappings { get; set; } private IEnumerable compiledMappings; public PersistenceModel(IConventionFinder conventionFinder) { - ConventionFinder = conventionFinder; + Conventions = conventionFinder; visitors.Add(new SeparateSubclassVisitor(subclassProviders)); - visitors.Add(new ConventionVisitor(ConventionFinder)); + visitors.Add(new ConventionVisitor(Conventions)); AddDefaultConventions(); } @@ -45,7 +45,7 @@ private void AddDefaultConventions() where type.Namespace == "FluentNHibernate.Conventions.Defaults" && !type.IsAbstract select type) { - ConventionFinder.Add(foundType); + Conventions.Add(foundType); } }