Skip to content
Browse files

Got ForeignKey conventions working again for many-to-one's. Baby steps.

  • Loading branch information...
1 parent db6c58b commit bb50da5868adc5069eef35f32d91293dfd7e5fce @jagregory committed
Showing with 773 additions and 429 deletions.
  1. +47 −0 src/AlterationDslCoverage.ncover
  2. +8 −8 ...ibernate.Testing/ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaCollectionTests.cs
  3. +6 −6 ...te.Testing/ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaEqualComplexTypeTests.cs
  4. +6 −6 ...Testing/ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaEqualSimpleTypeEvalTests.cs
  5. +6 −6 ...ate.Testing/ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaEqualSimpleTypeTests.cs
  6. +1 −1 ...te.Testing/ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaEqualSubPropertyTests.cs
  7. +2 −2 ...bernate.Testing/ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaInheritanceTests.cs
  8. +13 −13 ...entNHibernate.Testing/ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaIsSetTests.cs
  9. +5 −5 src/FluentNHibernate.Testing/ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaTests.cs
  10. +28 −0 src/FluentNHibernate.Testing/ConventionsTests/Alterations/PropertyAlterationMapsToPropertyMapping.cs
  11. +2 −1 src/FluentNHibernate.Testing/ConventionsTests/Inspection/ColumnDslMapsToColumnMapping.cs
  12. +1 −8 src/FluentNHibernate.Testing/ConventionsTests/Inspection/PropertyDslMapsToPropertyMapping.cs
  13. +15 −13 src/FluentNHibernate.Testing/DomainModel/Mapping/ClassMapXmlCreationTester.cs
  14. +1 −0 src/FluentNHibernate.Testing/FluentNHibernate.Testing.csproj
  15. +21 −14 src/FluentNHibernate.Testing/MappingModel/Output/XmlManyToOneWriterTester.cs
  16. +5 −0 src/FluentNHibernate/Conventions/Alterations/IColumnAlteration.cs
  17. +8 −0 src/FluentNHibernate/Conventions/Alterations/IManyToManyAlteration.cs
  18. +7 −0 src/FluentNHibernate/Conventions/Alterations/IManyToOneAlteration.cs
  19. +7 −0 src/FluentNHibernate/Conventions/Alterations/IOneToManyAlteration.cs
  20. +27 −3 src/FluentNHibernate/Conventions/ConventionVisitor.cs
  21. +7 −7 src/FluentNHibernate/Conventions/Defaults/DefaultForeignKeyConvention.cs
  22. +15 −0 src/FluentNHibernate/Conventions/DslImplementation/ColumnAlteration.cs
  23. +14 −18 src/FluentNHibernate/Conventions/DslImplementation/{ColumnDsl.cs → ColumnInspector.cs}
  24. +21 −0 src/FluentNHibernate/Conventions/DslImplementation/ManyToOneAlteration.cs
  25. +69 −0 src/FluentNHibernate/Conventions/DslImplementation/ManyToOneInspector.cs
  26. +98 −0 src/FluentNHibernate/Conventions/DslImplementation/PropertyAlteration.cs
  27. +0 −243 src/FluentNHibernate/Conventions/DslImplementation/PropertyDsl.cs
  28. +150 −0 src/FluentNHibernate/Conventions/DslImplementation/PropertyInspector.cs
  29. +47 −46 src/FluentNHibernate/Conventions/ForeignKeyConvention.cs
  30. +8 −0 src/FluentNHibernate/Conventions/IColumnConvention.cs
  31. +7 −6 src/FluentNHibernate/Conventions/IHasManyConvention.cs
  32. +7 −6 src/FluentNHibernate/Conventions/IHasManyToManyConvention.cs
  33. +0 −1 src/FluentNHibernate/Conventions/IPropertyConvention.cs
  34. +8 −6 src/FluentNHibernate/Conventions/IReferenceConvention.cs
  35. +7 −0 src/FluentNHibernate/Conventions/Inspections/Cascade.cs
  36. +7 −0 src/FluentNHibernate/Conventions/Inspections/IAccessInspector.cs
  37. +7 −0 src/FluentNHibernate/Conventions/Inspections/ICascadeInspector.cs
  38. +10 −0 src/FluentNHibernate/Conventions/Inspections/IManyToManyInspector.cs
  39. +12 −0 src/FluentNHibernate/Conventions/Inspections/IManyToOneInspector.cs
  40. +9 −0 src/FluentNHibernate/Conventions/Inspections/IOneToManyInspector.cs
  41. +7 −0 src/FluentNHibernate/Conventions/Inspections/IOuterJoinInspector.cs
  42. +1 −2 src/FluentNHibernate/Conventions/Inspections/IPropertyInspector.cs
  43. +7 −0 src/FluentNHibernate/Conventions/Inspections/OuterJoin.cs
  44. +19 −2 src/FluentNHibernate/FluentNHibernate.csproj
  45. +3 −4 src/FluentNHibernate/Mapping/ManyToOnePart.cs
  46. +1 −1 src/FluentNHibernate/MappingModel/DiscriminatorMapping.cs
  47. +1 −0 src/FluentNHibernate/MappingModel/ManyToOneMapping.cs
  48. +14 −0 src/FluentNHibernate/MappingModel/Output/XmlManyToOneWriter.cs
  49. +1 −1 src/FluentNHibernate/MappingModel/Output/XmlWriterContainer.cs
View
47 src/AlterationDslCoverage.ncover
@@ -0,0 +1,47 @@
+<?xml version="1.0"?>
+<NCover3ProjectSetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="307">
+ <CoverageDataURL>C:\Documents and Settings\Administrator\dev\fluent-nhibernate\src\FluentNHibernate.Testing\bin\x86\Debug\coverage.xml</CoverageDataURL>
+ <ShowExcludedNodes>false</ShowExcludedNodes>
+ <DefaultViewSetting SatisfactoryBranchThreshold="95" SatisfactoryCoverageThreshold="95" SatisfactoryCyclomaticComplexityThreshold="20" SatisfactoryFunctionThreshold="80" SatisfactoryUnvisitedSequencePoints="0" WidgetType="TreeView" FilterStyle="None" ReportStyle="SequencePointCoveragePercentage" SortStyle="Name">
+ <DelayFilters>false</DelayFilters>
+ <filters />
+ </DefaultViewSetting>
+ <NCoverRunSettings>
+ <AutoExclude>true</AutoExclude>
+ <CommandLineArgs>FluentNHibernate.Testing.dll /include="Alteration DSL"</CommandLineArgs>
+ <CommandLineExe>C:\Documents and Settings\Administrator\dev\fluent-nhibernate\tools\nunit\nunit-console.exe</CommandLineExe>
+ <CoverageType>Symbol Branch CyclomaticComplexity MethodVisits</CoverageType>
+ <CoverageXml>coverage.xml</CoverageXml>
+ <TypeExclusionPatterns>FluentNHibernate.MappingModel.(Conventions|Output|).*</TypeExclusionPatterns>
+ <MethodExclusionPatterns>.*\.Add.*</MethodExclusionPatterns>
+ <MethodExclusionPatterns>.*\.AcceptVisitor</MethodExclusionPatterns>
+ <MethodExclusionPatterns>.*\.I.*Inspector\..*</MethodExclusionPatterns>
+ <Assemblies>FluentNHibernate</Assemblies>
+ <IncludedClassNames>FluentNHibernate.Conventions.DslImplementation.*</IncludedClassNames>
+ <IncludedClassNames>FluentNHibernate.Conventions.Alterations.*</IncludedClassNames>
+ <IncludedClassNames>FluentNHibernate.MappingModel.*</IncludedClassNames>
+ <LogFile>coverage.log</LogFile>
+ <LoggingLevel>None</LoggingLevel>
+ <NCoverExe>C:\Program Files\NCover\ncover.console.exe</NCoverExe>
+ <ProfileIIS>false</ProfileIIS>
+ <ProfileWindowsApplication>true</ProfileWindowsApplication>
+ <ProfileWindowsService>false</ProfileWindowsService>
+ <ProjectName>New Project</ProjectName>
+ <RegisterForUser>true</RegisterForUser>
+ <ServiceTimeout>0</ServiceTimeout>
+ <SymbolSearchPolicy>12</SymbolSearchPolicy>
+ <VersionNumber>158</VersionNumber>
+ <WaitForAppLoad>1</WaitForAppLoad>
+ <WorkingDirectory>C:\Documents and Settings\Administrator\dev\fluent-nhibernate\src\FluentNHibernate.Testing\bin\x86\Debug</WorkingDirectory>
+ </NCoverRunSettings>
+ <ProjectGuid>19d27372-881d-4a6d-b83c-c832f4bcab50</ProjectGuid>
+ <ProjectName>New Project</ProjectName>
+ <RebasedPaths>
+ <Path>
+ <RebasedPath>c:\documents and settings\administrator\dev\fluent-nhibernate\src\fluentnhibernate\conventions\dslimplementation\columndsl.cs</RebasedPath>
+ <SourcePath>c:\documents and settings\administrator\dev\fluent-nhibernate\src\fluentnhibernate\conventions\dslimplementation\columndsl.cs</SourcePath>
+ </Path>
+ </RebasedPaths>
+ <ReportPath />
+ <SyncPathWithWorkingDirectory>false</SyncPathWithWorkingDirectory>
+</NCover3ProjectSetting>
View
16 ....Testing/ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaCollectionTests.cs
@@ -26,7 +26,7 @@ public void CollectionIsEmptyShouldBeTrueWhenUsingExpression()
.Expect(x => x.Columns.IsEmpty());
acceptance
- .Matches(new PropertyDsl(new PropertyMapping()))
+ .Matches(new PropertyInspector(new PropertyMapping()))
.ShouldBeTrue();
}
@@ -40,7 +40,7 @@ public void CollectionIsEmptyShouldBeFalseWithItemsWhenUsingExpression()
mapping.AddColumn(new ColumnMapping { Name = "Column1" });
acceptance
- .Matches(new PropertyDsl(mapping))
+ .Matches(new PropertyInspector(mapping))
.ShouldBeFalse();
}
@@ -51,7 +51,7 @@ public void CollectionIsNotEmptyShouldBeFalseWhenUsingExpression()
.Expect(x => x.Columns.IsNotEmpty());
acceptance
- .Matches(new PropertyDsl(new PropertyMapping()))
+ .Matches(new PropertyInspector(new PropertyMapping()))
.ShouldBeFalse();
}
@@ -65,7 +65,7 @@ public void CollectionIsNotEmptyShouldBeTrueWithItemsWhenUsingExpression()
mapping.AddColumn(new ColumnMapping { Name = "Column1" });
acceptance
- .Matches(new PropertyDsl(mapping))
+ .Matches(new PropertyInspector(mapping))
.ShouldBeTrue();
}
@@ -79,7 +79,7 @@ public void CollectionContainsWithStringShouldBeFalseWhenNoItemsMatching()
mapping.AddColumn(new ColumnMapping { Name = "Column1" });
acceptance
- .Matches(new PropertyDsl(mapping))
+ .Matches(new PropertyInspector(mapping))
.ShouldBeFalse();
}
@@ -93,7 +93,7 @@ public void CollectionContainsWithStringShouldBeTrueWhenItemsMatching()
mapping.AddColumn(new ColumnMapping { Name = "Column1" });
acceptance
- .Matches(new PropertyDsl(mapping))
+ .Matches(new PropertyInspector(mapping))
.ShouldBeTrue();
}
@@ -107,7 +107,7 @@ public void CollectionContainsWithLambdaShouldBeFalseWhenNoItemsMatching()
mapping.AddColumn(new ColumnMapping { Name = "Column1" });
acceptance
- .Matches(new PropertyDsl(mapping))
+ .Matches(new PropertyInspector(mapping))
.ShouldBeFalse();
}
@@ -121,7 +121,7 @@ public void CollectionContainsWithLambdaShouldBeTrueWhenItemsMatching()
mapping.AddColumn(new ColumnMapping { Name = "Column1" });
acceptance
- .Matches(new PropertyDsl(mapping))
+ .Matches(new PropertyInspector(mapping))
.ShouldBeTrue();
}
}
View
12 ...ng/ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaEqualComplexTypeTests.cs
@@ -24,7 +24,7 @@ public void ExpectEqualShouldValidateToTrueIfGivenMatchingModel()
acceptance.Expect(x => x.Access == Access.AsField());
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Access = "field" }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Access = "field" }))
.ShouldBeTrue();
}
@@ -34,7 +34,7 @@ public void ExpectEqualShouldValidateToFalseIfNotGivenMatchingModel()
acceptance.Expect(x => x.Access == Access.AsField());
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Access = "property" }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Access = "property" }))
.ShouldBeFalse();
}
@@ -44,7 +44,7 @@ public void ExpectEqualShouldValidateToFalseIfUnset()
acceptance.Expect(x => x.Access == Access.AsField());
acceptance
- .Matches(new PropertyDsl(new PropertyMapping()))
+ .Matches(new PropertyInspector(new PropertyMapping()))
.ShouldBeFalse();
}
@@ -54,7 +54,7 @@ public void ExpectNotEqualShouldValidateToTrueIfGivenMatchingModel()
acceptance.Expect(x => x.Access != Access.AsField());
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Access = "property" }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Access = "property" }))
.ShouldBeTrue();
}
@@ -64,7 +64,7 @@ public void ExpectNotEqualShouldValidateToFalseIfNotGivenMatchingModel()
acceptance.Expect(x => x.Access != Access.AsField());
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Access = "field" }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Access = "field" }))
.ShouldBeFalse();
}
@@ -74,7 +74,7 @@ public void ExpectNotEqualShouldValidateToTrueIfUnset()
acceptance.Expect(x => x.Access != Access.AsField());
acceptance
- .Matches(new PropertyDsl(new PropertyMapping()))
+ .Matches(new PropertyInspector(new PropertyMapping()))
.ShouldBeTrue();
}
}
View
12 ...ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaEqualSimpleTypeEvalTests.cs
@@ -23,7 +23,7 @@ public void ExpectEqualShouldValidateToTrueIfGivenMatchingModel()
acceptance.Expect(x => x.Insert == true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = true }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = true }))
.ShouldBeTrue();
}
@@ -33,7 +33,7 @@ public void ExpectEqualShouldValidateToFalseIfNotGivenMatchingModel()
acceptance.Expect(x => x.Insert == true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = false }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = false }))
.ShouldBeFalse();
}
@@ -43,7 +43,7 @@ public void ExpectEqualShouldValidateToFalseIfUnset()
acceptance.Expect(x => x.Insert == true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping()))
+ .Matches(new PropertyInspector(new PropertyMapping()))
.ShouldBeFalse();
}
@@ -53,7 +53,7 @@ public void ExpectNotEqualShouldValidateToTrueIfGivenMatchingModel()
acceptance.Expect(x => x.Insert != true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = false }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = false }))
.ShouldBeTrue();
}
@@ -63,7 +63,7 @@ public void ExpectNotEqualShouldValidateToFalseIfNotGivenMatchingModel()
acceptance.Expect(x => x.Insert != true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = true }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = true }))
.ShouldBeFalse();
}
@@ -73,7 +73,7 @@ public void ExpectNotEqualShouldValidateToTrueIfUnset()
acceptance.Expect(x => x.Insert != true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping()))
+ .Matches(new PropertyInspector(new PropertyMapping()))
.ShouldBeTrue();
}
}
View
12 ...ing/ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaEqualSimpleTypeTests.cs
@@ -25,7 +25,7 @@ public void ExpectEqualShouldValidateToTrueIfGivenMatchingModel()
acceptance.Expect(x => x.Insert == true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = true }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = true }))
.ShouldBeTrue();
}
@@ -35,7 +35,7 @@ public void ExpectEqualShouldValidateToFalseIfNotGivenMatchingModel()
acceptance.Expect(x => x.Insert == true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = false }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = false }))
.ShouldBeFalse();
}
@@ -45,7 +45,7 @@ public void ExpectEqualShouldValidateToFalseIfUnset()
acceptance.Expect(x => x.Insert == true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping()))
+ .Matches(new PropertyInspector(new PropertyMapping()))
.ShouldBeFalse();
}
@@ -55,7 +55,7 @@ public void ExpectNotEqualShouldValidateToTrueIfGivenMatchingModel()
acceptance.Expect(x => x.Insert != true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = false }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = false }))
.ShouldBeTrue();
}
@@ -65,7 +65,7 @@ public void ExpectNotEqualShouldValidateToFalseIfNotGivenMatchingModel()
acceptance.Expect(x => x.Insert != true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = true }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = true }))
.ShouldBeFalse();
}
@@ -75,7 +75,7 @@ public void ExpectNotEqualShouldValidateToTrueIfUnset()
acceptance.Expect(x => x.Insert != true);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping()))
+ .Matches(new PropertyInspector(new PropertyMapping()))
.ShouldBeTrue();
}
}
View
2 ...ng/ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaEqualSubPropertyTests.cs
@@ -25,7 +25,7 @@ public void ExpectShouldEvaluateSubPropertyWithEvaluation()
{
acceptance.Expect(x => x.Type.Name == typeof(int).Name);
- acceptance.Matches(new PropertyDsl(new PropertyMapping { PropertyInfo = ReflectionHelper.GetProperty<Record>(x => x.Age) }))
+ acceptance.Matches(new PropertyInspector(new PropertyMapping { PropertyInfo = ReflectionHelper.GetProperty<Record>(x => x.Age) }))
.ShouldBeTrue();
}
}
View
4 ...Testing/ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaInheritanceTests.cs
@@ -36,7 +36,7 @@ public void ShouldUseInheritedCriteria()
acceptance
.SameAs<AnotherConvention>();
- acceptance.Matches(new PropertyDsl(new PropertyMapping
+ acceptance.Matches(new PropertyInspector(new PropertyMapping
{
Insert = false,
Update = false
@@ -60,7 +60,7 @@ public void ShouldUseInheritedOppositeCriteria()
acceptance
.OppositeOf<AnotherConvention>();
- acceptance.Matches(new PropertyDsl(new PropertyMapping
+ acceptance.Matches(new PropertyInspector(new PropertyMapping
{
Insert = true,
Update = true
View
26 ...rnate.Testing/ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaIsSetTests.cs
@@ -25,7 +25,7 @@ public void ExpectSetShouldValidateToTrueIfGivenMatchingModel()
acceptance.Expect(x => x.Insert, Is.Set);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() {Insert = true}))
+ .Matches(new PropertyInspector(new PropertyMapping() {Insert = true}))
.ShouldBeTrue();
}
@@ -35,7 +35,7 @@ public void ExpectSetShouldValidateToFalseIfNotGivenMatchingModel()
acceptance.Expect(x => x.Insert, Is.Set);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping()))
+ .Matches(new PropertyInspector(new PropertyMapping()))
.ShouldBeFalse();
}
@@ -47,7 +47,7 @@ public void MultipleExpectSetsShouldValidateToTrueIfGivenMatchingModel()
.Expect(x => x.Update, Is.Set);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = true, Update = true }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = true, Update = true }))
.ShouldBeTrue();
}
@@ -59,7 +59,7 @@ public void MultipleExpectSetsShouldValidateToFalseIfOnlyOneMatches()
.Expect(x => x.Update, Is.Set);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = true }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = true }))
.ShouldBeFalse();
}
@@ -71,7 +71,7 @@ public void MultipleExpectSetsShouldValidateToFalseIfNoneMatch()
.Expect(x => x.Update, Is.Set);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping()))
+ .Matches(new PropertyInspector(new PropertyMapping()))
.ShouldBeFalse();
}
@@ -81,7 +81,7 @@ public void ExpectNotSetShouldValidateToTrueIfGivenMatchingModel()
acceptance.Expect(x => x.Insert, Is.Not.Set);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping()))
+ .Matches(new PropertyInspector(new PropertyMapping()))
.ShouldBeTrue();
}
@@ -91,7 +91,7 @@ public void ExpectNotSetShouldValidateToFalseIfNotGivenMatchingModel()
acceptance.Expect(x => x.Insert, Is.Not.Set);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = true }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = true }))
.ShouldBeFalse();
}
@@ -103,7 +103,7 @@ public void MultipleExpectNotSetsShouldValidateToTrueIfGivenMatchingModel()
.Expect(x => x.Update, Is.Not.Set);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping()))
+ .Matches(new PropertyInspector(new PropertyMapping()))
.ShouldBeTrue();
}
@@ -115,7 +115,7 @@ public void MultipleExpectNotSetsShouldValidateToFalseIfOnlyOneMatches()
.Expect(x => x.Update, Is.Not.Set);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = true }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = true }))
.ShouldBeFalse();
}
@@ -127,7 +127,7 @@ public void MultipleExpectNotSetsShouldValidateToFalseIfNoneMatch()
.Expect(x => x.Update, Is.Not.Set);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = true, Update = true }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = true, Update = true }))
.ShouldBeFalse();
}
@@ -139,7 +139,7 @@ public void CombinationOfSetAndNotSetShouldValidateToTrueWhenGivenMatchingModel(
.Expect(x => x.Update, Is.Set);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Update = true }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Update = true }))
.ShouldBeTrue();
}
@@ -151,7 +151,7 @@ public void CombinationOfSetAndNotSetShouldValidateToFalseWhenOnlyOneMatches()
.Expect(x => x.Update, Is.Set);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping()))
+ .Matches(new PropertyInspector(new PropertyMapping()))
.ShouldBeFalse();
}
@@ -163,7 +163,7 @@ public void CombinationOfSetAndNotSetShouldValidateToFalseWhenNoneMatch()
.Expect(x => x.Update, Is.Set);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = true }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = true }))
.ShouldBeFalse();
}
}
View
10 ...NHibernate.Testing/ConventionsTests/AcceptanceCriteria/PropertyAcceptanceCriteriaTests.cs
@@ -42,7 +42,7 @@ public void ExpectOnPropertyShouldValidateToTrueIfGivenMatchingModel()
acceptance.Expect(x => x.Insert, Is.Set);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = true }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = true }))
.ShouldBeTrue();
}
@@ -52,7 +52,7 @@ public void ExpectOnPropertyShouldValidateToFalseIfNotGivenMatchingModel()
acceptance.Expect(x => x.Insert, Is.Set);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping()))
+ .Matches(new PropertyInspector(new PropertyMapping()))
.ShouldBeFalse();
}
@@ -63,7 +63,7 @@ public void MultipleExpectsShouldValidateToTrueIfGivenMatchingModel()
acceptance.Expect(x => x.Update, Is.Set);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = true, Update = true }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = true, Update = true }))
.ShouldBeTrue();
}
@@ -74,7 +74,7 @@ public void MultipleExpectsShouldValidateToFalseIfOnlyOneMatches()
acceptance.Expect(x => x.Update, Is.Set);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping() { Insert = true }))
+ .Matches(new PropertyInspector(new PropertyMapping() { Insert = true }))
.ShouldBeFalse();
}
@@ -85,7 +85,7 @@ public void MultipleExpectsShouldValidateToFalseIfNoneMatch()
acceptance.Expect(x => x.Update, Is.Set);
acceptance
- .Matches(new PropertyDsl(new PropertyMapping()))
+ .Matches(new PropertyInspector(new PropertyMapping()))
.ShouldBeFalse();
}
}
View
28 ...Hibernate.Testing/ConventionsTests/Alterations/PropertyAlterationMapsToPropertyMapping.cs
@@ -0,0 +1,28 @@
+using FluentNHibernate.Conventions.Alterations;
+using FluentNHibernate.Conventions.DslImplementation;
+using FluentNHibernate.MappingModel;
+using NUnit.Framework;
+
+namespace FluentNHibernate.Testing.ConventionsTests.Alterations
+{
+ [TestFixture, Category("Alteration DSL")]
+ public class PropertyAlterationMapsToPropertyMapping
+ {
+ private PropertyMapping mapping;
+ private IPropertyAlteration alteration;
+
+ [SetUp]
+ public void CreateDsl()
+ {
+ mapping = new PropertyMapping();
+ alteration = new PropertyAlteration(mapping);
+ }
+
+ [Test]
+ public void AccessMapped()
+ {
+ alteration.Access.AsField();
+ mapping.Access.ShouldEqual("field");
+ }
+ }
+}
View
3 src/FluentNHibernate.Testing/ConventionsTests/Inspection/ColumnDslMapsToColumnMapping.cs
@@ -4,6 +4,7 @@
using FluentNHibernate.Conventions.DslImplementation;
using FluentNHibernate.Conventions.Inspections;
using FluentNHibernate.MappingModel;
+using FluentNHibernate.Testing.DomainModel;
using FluentNHibernate.Utils;
using NUnit.Framework;
@@ -19,7 +20,7 @@ public class ColumnDslMapsToColumnMapping
public void CreateDsl()
{
mapping = new ColumnMapping();
- inspector = new ColumnDsl(new PropertyMapping(), mapping);
+ inspector = new ColumnInspector(typeof(Record), mapping);
}
[Test]
View
9 src/FluentNHibernate.Testing/ConventionsTests/Inspection/PropertyDslMapsToPropertyMapping.cs
@@ -20,7 +20,7 @@ public class PropertyDslMapsToPropertyMapping
public void CreateDsl()
{
mapping = new PropertyMapping();
- inspector = new PropertyDsl(mapping);
+ inspector = new PropertyInspector(mapping);
}
[Test]
@@ -74,13 +74,6 @@ public void EntityTypeMappedToClrType()
}
[Test]
- public void EntityTypeIsSet()
- {
- inspector.IsSet(Prop(x => x.EntityType))
- .ShouldBeTrue();
- }
-
- [Test]
public void FormulaMapped()
{
mapping.Formula = "formula";
View
28 src/FluentNHibernate.Testing/DomainModel/Mapping/ClassMapXmlCreationTester.cs
@@ -108,8 +108,8 @@ public void BasicOneToManyMapping()
.ForMapping(map => map.HasMany(x => x.Children))
.Element("class/bag")
.HasAttribute("name", "Children")
- .Element("class/bag/key")
- .HasAttribute("column", "MappedObject_id")
+ .Element("class/bag/key/column")
+ .HasAttribute("name", "MappedObject_id")
.Element("class/bag/one-to-many")
.HasAttribute("class", typeof (ChildObject).AssemblyQualifiedName);
}
@@ -241,7 +241,7 @@ public void Map_an_enumeration()
}
[Test]
- public void Map_a_nullable_enumeration()
+ public void MapANullableEnumeration()
{
new MappingTester<MappedObject>()
.ForMapping(m => m.Map(x => x.NullableColor))
@@ -260,7 +260,7 @@ public void MapASimplePropertyWithNoOverrides()
.ForMapping(map => map.Map(x => x.Name))
.Element("//property[@name='Name']")
.Exists()
- .HasAttribute("type", "String")
+ .HasAttribute("type", typeof(string).AssemblyQualifiedName)
.Element("//property[@name='Name']/column")
.Exists()
.HasAttribute("name", "Name");
@@ -321,23 +321,25 @@ public void DomainClassMapWithIdNoColumnAndGenerator()
}
[Test]
- public void Creating_a_many_to_one_reference_with_column_specified()
+ public void CreatingAManyToOneReferenceWithColumnSpecified()
{
new MappingTester<MappedObject>()
.ForMapping(m => m.References(x => x.Parent, "MyParentId"))
- .Element("class/many-to-one").HasAttribute("column", "MyParentId");
+ .Element("class/many-to-one/column")
+ .HasAttribute("name", "MyParentId");
}
[Test]
- public void Creating_a_many_to_one_reference_with_column_specified_through_ColumnName_method()
+ public void CreatingAManyToOneReferenceWithColumnSpecifiedThroughColumnNameMethod()
{
new MappingTester<MappedObject>()
.ForMapping(m => m.References(x => x.Parent).ColumnName("MyParentId"))
- .Element("class/many-to-one").HasAttribute("column", "MyParentId");
+ .Element("class/many-to-one/column")
+ .HasAttribute("name", "MyParentId");
}
[Test]
- public void Creating_a_many_to_one_reference_using_specified_foreign_key()
+ public void CreatingAManyToOneReferenceUsingSpecifiedForeignKey()
{
new MappingTester<MappedObject>()
.ForMapping(m => m.References(x => x.Parent).WithForeignKey("FK_MyForeignKey"))
@@ -345,7 +347,7 @@ public void Creating_a_many_to_one_reference_using_specified_foreign_key()
}
[Test]
- public void Creating_a_many_to_one_reference_with_cascade_specified_as_None()
+ public void CreatingAManyToOneReferenceWithCascadeSpecifiedAsNone()
{
new MappingTester<MappedObject>()
.ForMapping(m => m.References(x => x.Parent).Cascade.None())
@@ -353,7 +355,7 @@ public void Creating_a_many_to_one_reference_with_cascade_specified_as_None()
}
[Test]
- public void Creating_a_many_to_one_reference_with_fetchtype_set()
+ public void CreatingAManyToOneReferenceWithFetchtypeSet()
{
new MappingTester<MappedObject>()
.ForMapping(m => m.References(x => x.Parent).Fetch.Select())
@@ -377,7 +379,7 @@ public void SpanningClassAcrossTwoTables()
}
[Test]
- public void Can_set_readonly()
+ public void CanSetReadonly()
{
new MappingTester<MappedObject>()
.ForMapping(m => m.ReadOnly())
@@ -385,7 +387,7 @@ public void Can_set_readonly()
}
[Test]
- public void Can_set_non_readonly()
+ public void CanSetNonReadonly()
{
new MappingTester<MappedObject>()
.ForMapping(m => m.Not.ReadOnly())
View
1 src/FluentNHibernate.Testing/FluentNHibernate.Testing.csproj
@@ -88,6 +88,7 @@
<Compile Include="ConventionFinderTests\FindTests.cs" />
<Compile Include="ConventionsTests\AcceptanceCriteria\PropertyAcceptanceCriteriaCollectionTests.cs" />
<Compile Include="ConventionsTests\AcceptanceCriteria\PropertyAcceptanceCriteriaInheritanceTests.cs" />
+ <Compile Include="ConventionsTests\Alterations\PropertyAlterationMapsToPropertyMapping.cs" />
<Compile Include="ConventionsTests\ConventionsCollectionTests.cs" />
<Compile Include="ConventionsTests\Inspection\ColumnDslMapsToColumnMapping.cs" />
<Compile Include="ConventionsTests\Inspection\PropertyDslMapsToPropertyMapping.cs" />
View
35 src/FluentNHibernate.Testing/MappingModel/Output/XmlManyToOneWriterTester.cs
@@ -1,5 +1,6 @@
using FluentNHibernate.MappingModel;
using FluentNHibernate.MappingModel.Output;
+using FluentNHibernate.Testing.DomainModel;
using FluentNHibernate.Testing.Testing;
using NUnit.Framework;
@@ -8,12 +9,18 @@ namespace FluentNHibernate.Testing.MappingModel.Output
[TestFixture]
public class XmlManyToOneWriterTester
{
- private XmlManyToOneWriter writer;
+ private IXmlWriter<ManyToOneMapping> writer;
+
+ [SetUp]
+ public void GetWriterFromContainer()
+ {
+ var container = new XmlWriterContainer();
+ writer = container.Resolve<IXmlWriter<ManyToOneMapping>>();
+ }
[Test]
public void ShouldWriteAccessAttribute()
{
- writer = new XmlManyToOneWriter();
var testHelper = new XmlWriterTestHelper<ManyToOneMapping>();
testHelper.Check(x => x.Access, "access").MapsToAttribute("access");
@@ -23,7 +30,6 @@ public void ShouldWriteAccessAttribute()
[Test]
public void ShouldWriteCascadeAttribute()
{
- writer = new XmlManyToOneWriter();
var testHelper = new XmlWriterTestHelper<ManyToOneMapping>();
testHelper.Check(x => x.Cascade, "all").MapsToAttribute("cascade");
@@ -33,9 +39,8 @@ public void ShouldWriteCascadeAttribute()
[Test]
public void ShouldWriteClassAttribute()
{
- writer = new XmlManyToOneWriter();
var testHelper = new XmlWriterTestHelper<ManyToOneMapping>();
- testHelper.Check(x => x.Class, "type").MapsToAttribute("class");
+ testHelper.Check(x => x.Class, new TypeReference(typeof(Record))).MapsToAttribute("class");
testHelper.VerifyAll(writer);
}
@@ -43,7 +48,6 @@ public void ShouldWriteClassAttribute()
[Test]
public void ShouldWriteFetchAttribute()
{
- writer = new XmlManyToOneWriter();
var testHelper = new XmlWriterTestHelper<ManyToOneMapping>();
testHelper.Check(x => x.Fetch, "select").MapsToAttribute("fetch");
@@ -53,7 +57,6 @@ public void ShouldWriteFetchAttribute()
[Test]
public void ShouldWriteForeignKeyAttribute()
{
- writer = new XmlManyToOneWriter();
var testHelper = new XmlWriterTestHelper<ManyToOneMapping>();
testHelper.Check(x => x.ForeignKey, "fk").MapsToAttribute("foreign-key");
@@ -63,7 +66,6 @@ public void ShouldWriteForeignKeyAttribute()
[Test]
public void ShouldWriteInsertAttribute()
{
- writer = new XmlManyToOneWriter();
var testHelper = new XmlWriterTestHelper<ManyToOneMapping>();
testHelper.Check(x => x.Insert, true).MapsToAttribute("insert");
@@ -73,7 +75,6 @@ public void ShouldWriteInsertAttribute()
[Test]
public void ShouldWriteLazyAttribute()
{
- writer = new XmlManyToOneWriter();
var testHelper = new XmlWriterTestHelper<ManyToOneMapping>();
testHelper.Check(x => x.Lazy, true).MapsToAttribute("lazy");
@@ -83,7 +84,6 @@ public void ShouldWriteLazyAttribute()
[Test]
public void ShouldWriteNameAttribute()
{
- writer = new XmlManyToOneWriter();
var testHelper = new XmlWriterTestHelper<ManyToOneMapping>();
testHelper.Check(x => x.Name, "nm").MapsToAttribute("name");
@@ -93,7 +93,6 @@ public void ShouldWriteNameAttribute()
[Test]
public void ShouldWriteNotFoundAttribute()
{
- writer = new XmlManyToOneWriter();
var testHelper = new XmlWriterTestHelper<ManyToOneMapping>();
testHelper.Check(x => x.NotFound, "nf").MapsToAttribute("not-found");
@@ -103,7 +102,6 @@ public void ShouldWriteNotFoundAttribute()
[Test]
public void ShouldWriteOuterJoinAttribute()
{
- writer = new XmlManyToOneWriter();
var testHelper = new XmlWriterTestHelper<ManyToOneMapping>();
testHelper.Check(x => x.OuterJoin, "outer-join").MapsToAttribute("outer-join");
@@ -113,7 +111,6 @@ public void ShouldWriteOuterJoinAttribute()
[Test]
public void ShouldWritePropertyRefAttribute()
{
- writer = new XmlManyToOneWriter();
var testHelper = new XmlWriterTestHelper<ManyToOneMapping>();
testHelper.Check(x => x.PropertyRef, "pr").MapsToAttribute("property-ref");
@@ -123,12 +120,22 @@ public void ShouldWritePropertyRefAttribute()
[Test]
public void ShouldWriteUpdateAttribute()
{
- writer = new XmlManyToOneWriter();
var testHelper = new XmlWriterTestHelper<ManyToOneMapping>();
testHelper.Check(x => x.Update, true).MapsToAttribute("update");
testHelper.VerifyAll(writer);
}
+ [Test]
+ public void ShouldWriteColumns()
+ {
+ var mapping = new ManyToOneMapping();
+
+ mapping.AddColumn(new ColumnMapping());
+
+ writer.VerifyXml(mapping)
+ .Element("column").Exists();
+ }
+
}
}
View
5 src/FluentNHibernate/Conventions/Alterations/IColumnAlteration.cs
@@ -0,0 +1,5 @@
+namespace FluentNHibernate.Conventions.Alterations
+{
+ public interface IColumnAlteration
+ {}
+}
View
8 src/FluentNHibernate/Conventions/Alterations/IManyToManyAlteration.cs
@@ -0,0 +1,8 @@
+namespace FluentNHibernate.Conventions.Alterations
+{
+ public interface IManyToManyAlteration
+ {
+ void ParentKeyColumn(string columnName);
+ void ChildKeyColumn(string columnName);
+ }
+}
View
7 src/FluentNHibernate/Conventions/Alterations/IManyToOneAlteration.cs
@@ -0,0 +1,7 @@
+namespace FluentNHibernate.Conventions.Alterations
+{
+ public interface IManyToOneAlteration
+ {
+ void ColumnName(string columnName);
+ }
+}
View
7 src/FluentNHibernate/Conventions/Alterations/IOneToManyAlteration.cs
@@ -0,0 +1,7 @@
+namespace FluentNHibernate.Conventions.Alterations
+{
+ public interface IOneToManyAlteration
+ {
+ void KeyColumnName(string columnName);
+ }
+}
View
30 src/FluentNHibernate/Conventions/ConventionVisitor.cs
@@ -1,4 +1,5 @@
-using System.Collections;
+using System;
+using System.Collections;
using FluentNHibernate.Conventions.AcceptanceCriteria;
using FluentNHibernate.Conventions.Alterations;
using FluentNHibernate.Conventions.DslImplementation;
@@ -12,6 +13,8 @@ public class ConventionVisitor : DefaultMappingModelVisitor
{
private readonly IConventionFinder finder;
+ private Type currentType;
+
public ConventionVisitor(IConventionFinder finder)
{
this.finder = finder;
@@ -22,15 +25,36 @@ public override void ProcessClass(ClassMapping classMapping)
var dsl = new ClassDsl(classMapping);
var conventions = finder.Find<IClassConvention>();
+ currentType = classMapping.Type;
+
Apply<IClassInspector, IClassAlteration>(conventions, dsl, dsl);
}
public override void ProcessProperty(PropertyMapping propertyMapping)
{
- var dsl = new PropertyDsl(propertyMapping);
var conventions = finder.Find<IPropertyConvention>();
- Apply<IPropertyInspector, IPropertyAlteration>(conventions, dsl, dsl);
+ Apply<IPropertyInspector, IPropertyAlteration>(conventions,
+ new PropertyInspector(propertyMapping),
+ new PropertyAlteration(propertyMapping));
+ }
+
+ public override void ProcessColumn(ColumnMapping columnMapping)
+ {
+ var conventions = finder.Find<IColumnConvention>();
+
+ Apply<IColumnInspector, IColumnAlteration>(conventions,
+ new ColumnInspector(currentType, columnMapping),
+ new ColumnAlteration(columnMapping));
+ }
+
+ public override void ProcessManyToOne(ManyToOneMapping manyToOneMapping)
+ {
+ var conventions = finder.Find<IReferenceConvention>();
+
+ Apply<IManyToOneInspector, IManyToOneAlteration>(conventions,
+ new ManyToOneInspector(manyToOneMapping),
+ new ManyToOneAlteration(manyToOneMapping));
}
private void Apply<TInspector, TAlteration>(IEnumerable conventions, TInspector inspection, TAlteration alteration)
View
14 src/FluentNHibernate/Conventions/Defaults/DefaultForeignKeyConvention.cs
@@ -3,11 +3,11 @@
namespace FluentNHibernate.Conventions.Defaults
{
- //public class DefaultForeignKeyConvention : ForeignKeyConvention
- //{
- // protected override string GetKeyName(PropertyInfo property, Type type)
- // {
- // return (property != null ? property.Name : type.Name) + "_id";
- // }
- //}
+ public class DefaultForeignKeyConvention : ForeignKeyConvention
+ {
+ protected override string GetKeyName(PropertyInfo property, Type type)
+ {
+ return (property != null ? property.Name : type.Name) + "_id";
+ }
+ }
}
View
15 src/FluentNHibernate/Conventions/DslImplementation/ColumnAlteration.cs
@@ -0,0 +1,15 @@
+using FluentNHibernate.Conventions.Alterations;
+using FluentNHibernate.MappingModel;
+
+namespace FluentNHibernate.Conventions.DslImplementation
+{
+ public class ColumnAlteration : IColumnAlteration
+ {
+ private readonly ColumnMapping mapping;
+
+ public ColumnAlteration(ColumnMapping mapping)
+ {
+ this.mapping = mapping;
+ }
+ }
+}
View
32 ...onventions/DslImplementation/ColumnDsl.cs → ...ions/DslImplementation/ColumnInspector.cs
@@ -5,15 +5,14 @@
namespace FluentNHibernate.Conventions.DslImplementation
{
- public class ColumnDsl : IColumnInspector
+ public class ColumnInspector : IColumnInspector
{
- private readonly PropertyMapping propertyMapping;
private readonly ColumnMapping mapping;
private readonly InspectorModelMapper<IColumnInspector, ColumnMapping> propertyMappings = new InspectorModelMapper<IColumnInspector, ColumnMapping>();
- public ColumnDsl(PropertyMapping propertyMapping, ColumnMapping mapping)
+ public ColumnInspector(Type containingEntityType, ColumnMapping mapping)
{
- this.propertyMapping = propertyMapping;
+ EntityType = containingEntityType;
this.mapping = mapping;
propertyMappings.Map(x => x.Check, x => x.Check);
@@ -26,57 +25,54 @@ public ColumnDsl(PropertyMapping propertyMapping, ColumnMapping mapping)
propertyMappings.Map(x => x.UniqueKey, x => x.UniqueKey);
}
- public Type EntityType
- {
- get { return propertyMapping.ContainingEntityType; }
- }
+ public Type EntityType { get; private set; }
- string IColumnInspector.Name
+ public string Name
{
get { return mapping.Name; }
}
- string IColumnInspector.Check
+ public string Check
{
get { return mapping.Check; }
}
- string IColumnInspector.Index
+ public string Index
{
get { return mapping.Index; }
}
- int IColumnInspector.Length
+ public int Length
{
get { return mapping.Length; }
}
- bool IColumnInspector.NotNull
+ public bool NotNull
{
get { return mapping.NotNull; }
}
- string IColumnInspector.SqlType
+ public string SqlType
{
get { return mapping.SqlType; }
}
- bool IColumnInspector.Unique
+ public bool Unique
{
get { return mapping.Unique; }
}
- string IColumnInspector.UniqueKey
+ public string UniqueKey
{
get { return mapping.UniqueKey; }
}
- string IInspector.StringIdentifierForModel
+ public string StringIdentifierForModel
{
get { return mapping.Name; }
}
- bool IInspector.IsSet(PropertyInfo property)
+ public bool IsSet(PropertyInfo property)
{
return mapping.Attributes.IsSpecified(propertyMappings.Get(property));
}
View
21 src/FluentNHibernate/Conventions/DslImplementation/ManyToOneAlteration.cs
@@ -0,0 +1,21 @@
+using System;
+using FluentNHibernate.Conventions.Alterations;
+using FluentNHibernate.MappingModel;
+
+namespace FluentNHibernate.Conventions.DslImplementation
+{
+ public class ManyToOneAlteration : IManyToOneAlteration
+ {
+ private readonly ManyToOneMapping mapping;
+
+ public ManyToOneAlteration(ManyToOneMapping mapping)
+ {
+ this.mapping = mapping;
+ }
+
+ public void ColumnName(string columnName)
+ {
+ mapping.AddColumn(new ColumnMapping { Name = columnName });
+ }
+ }
+}
View
69 src/FluentNHibernate/Conventions/DslImplementation/ManyToOneInspector.cs
@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using FluentNHibernate.Conventions.Inspections;
+using FluentNHibernate.MappingModel;
+
+namespace FluentNHibernate.Conventions.DslImplementation
+{
+ public class ManyToOneInspector : IManyToOneInspector
+ {
+ private readonly ManyToOneMapping mapping;
+
+ public ManyToOneInspector(ManyToOneMapping mapping)
+ {
+ this.mapping = mapping;
+ }
+
+ public Access Access
+ {
+ get { throw new NotImplementedException(); }
+ }
+ public Cascade Cascade
+ {
+ get { throw new NotImplementedException(); }
+ }
+ public OuterJoin OuterJoin
+ {
+ get { throw new NotImplementedException(); }
+ }
+ public Type EntityType
+ {
+ get { throw new NotImplementedException(); }
+ }
+ public string StringIdentifierForModel
+ {
+ get { throw new NotImplementedException(); }
+ }
+ public bool IsSet(PropertyInfo property)
+ {
+ throw new NotImplementedException();
+ }
+
+ public PropertyInfo Property
+ {
+ get { return mapping.PropertyInfo; }
+ }
+
+ public string Name
+ {
+ get { throw new NotImplementedException(); }
+ }
+
+ public TypeReference Class
+ {
+ get { return mapping.Class; }
+ }
+
+ public IEnumerable<IColumnInspector> Columns
+ {
+ get
+ {
+ foreach (var column in mapping.Columns)
+ {
+ yield return new ColumnInspector(mapping.ContainedEntityType, column);
+ }
+ }
+ }
+ }
+}
View
98 src/FluentNHibernate/Conventions/DslImplementation/PropertyAlteration.cs
@@ -0,0 +1,98 @@
+using System;
+using FluentNHibernate.Conventions.Alterations;
+using FluentNHibernate.Mapping;
+using FluentNHibernate.MappingModel;
+
+namespace FluentNHibernate.Conventions.DslImplementation
+{
+ public class PropertyAlteration : IPropertyAlteration
+ {
+ private readonly PropertyMapping mapping;
+ private bool nextBool = true;
+
+ public PropertyAlteration(PropertyMapping mapping)
+ {
+ this.mapping = mapping;
+ }
+
+ public void Insert()
+ {
+ mapping.Insert = nextBool;
+ nextBool = true;
+ }
+
+ public void Update()
+ {
+ mapping.Update = nextBool;
+ nextBool = true;
+ }
+
+ public void ReadOnly()
+ {
+ mapping.Insert = mapping.Update = nextBool;
+ nextBool = true;
+ }
+
+ public void Nullable()
+ {
+ foreach (var column in mapping.Columns)
+ column.NotNull = !nextBool;
+
+ nextBool = true;
+ }
+
+ public IAccessStrategyBuilder Access
+ {
+ get { return new AccessMappingAlteration(mapping); }
+ }
+
+ public void CustomTypeIs<T>()
+ {
+ mapping.Type = new TypeReference(typeof(T));
+ }
+
+ public void CustomTypeIs(TypeReference type)
+ {
+ mapping.Type = type;
+ }
+
+ public void CustomTypeIs(Type type)
+ {
+ mapping.Type = new TypeReference(type);
+ }
+
+ public void CustomTypeIs(string type)
+ {
+ mapping.Type = new TypeReference(type);
+ }
+
+ public void CustomSqlTypeIs(string sqlType)
+ {
+ foreach (var column in mapping.Columns)
+ column.SqlType = sqlType;
+ }
+
+ public void Unique()
+ {
+ foreach (var column in mapping.Columns)
+ column.Unique = nextBool;
+
+ nextBool = true;
+ }
+
+ public void UniqueKey(string keyName)
+ {
+ foreach (var column in mapping.Columns)
+ column.UniqueKey = keyName;
+ }
+
+ public IPropertyAlteration Not
+ {
+ get
+ {
+ nextBool = !nextBool;
+ return this;
+ }
+ }
+ }
+}
View
243 src/FluentNHibernate/Conventions/DslImplementation/PropertyDsl.cs
@@ -1,243 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using FluentNHibernate.Conventions.Alterations;
-using FluentNHibernate.Conventions.Inspections;
-using FluentNHibernate.Mapping;
-using FluentNHibernate.MappingModel;
-using NHibernate.Properties;
-
-namespace FluentNHibernate.Conventions.DslImplementation
-{
- public class PropertyDsl : IPropertyInspector, IPropertyAlteration
- {
- private readonly PropertyMapping mapping;
- private readonly InspectorModelMapper<IPropertyInspector, PropertyMapping> propertyMappings = new InspectorModelMapper<IPropertyInspector, PropertyMapping>();
-
- public PropertyDsl(PropertyMapping mapping)
- {
- this.mapping = mapping;
-
- propertyMappings.Map(x => x.Insert, x => x.Insert);
- propertyMappings.Map(x => x.Update, x => x.Update);
- propertyMappings.Map(x => x.Type, x => x.Type);
- propertyMappings.Map(x => x.Access, x => x.Access);
- propertyMappings.Map(x => x.EntityType, x => x.ContainingEntityType);
- propertyMappings.Map(x => x.Formula, x => x.Formula);
- propertyMappings.Map(x => x.Name, x => x.Name);
- propertyMappings.Map(x => x.OptimisticLock, x => x.OptimisticLock);
- propertyMappings.Map(x => x.Generated, x => x.Generated);
- }
-
- /// <summary>
- /// Gets the requested value off the first column, as all columns are (currently) created equal
- /// </summary>
- /// <typeparam name="T"></typeparam>
- /// <returns></returns>
- private T GetValueFromColumns<T>(Func<ColumnMapping, object> property)
- {
- var column = mapping.Columns.FirstOrDefault();
-
- if (column != null)
- return (T)property(column);
-
- return default(T);
- }
-
- #region Inspection
-
- bool IPropertyInspector.Insert
- {
- get { return mapping.Insert; }
- }
-
- bool IPropertyInspector.Update
- {
- get { return mapping.Update; }
- }
-
- int IPropertyInspector.Length
- {
- get { return GetValueFromColumns<int>(x => x.Length); }
- }
-
- bool IPropertyInspector.Nullable
- {
- get { return !GetValueFromColumns<bool>(x => x.NotNull); }
- }
-
- string IPropertyInspector.Formula
- {
- get { return mapping.Formula; }
- }
-
- TypeReference IPropertyInspector.Type
- {
- get { return mapping.Type; }
- }
-
- string IPropertyInspector.SqlType
- {
- get { return GetValueFromColumns<string>(x => x.SqlType); }
- }
-
- bool IPropertyInspector.Unique
- {
- get { return GetValueFromColumns<bool>(x => x.Unique); }
- }
-
- string IPropertyInspector.UniqueKey
- {
- get { return GetValueFromColumns<string>(x => x.UniqueKey); }
- }
-
- string IPropertyInspector.Name
- {
- get { return mapping.Name; }
- }
-
- bool IPropertyInspector.OptimisticLock
- {
- get { return mapping.OptimisticLock; }
- }
-
- string IPropertyInspector.Generated
- {
- get { return mapping.Generated; }
- }
-
- public IEnumerable<IColumnInspector> Columns
- {
- get
- {
- foreach (var column in mapping.Columns)
- yield return new ColumnDsl(mapping, column);
- }
- }
-
- Access IPropertyInspector.Access
- {
- get
- {
- if (mapping.Attributes.IsSpecified(x => x.Access))
- return Access.FromString(mapping.Access);
-
- return Access.Unset;
- }
- }
-
- Type IInspector.EntityType
- {
- get { return mapping.ContainingEntityType; }
- }
-
- string IInspector.StringIdentifierForModel
- {
- get { return mapping.Name; }
- }
-
- bool IReadOnlyInspector.ReadOnly
- {
- get { return mapping.Insert && mapping.Update; }
- }
-
- PropertyInfo IExposedThroughPropertyInspector.Property
- {
- get { return mapping.PropertyInfo; }
- }
-
- bool IInspector.IsSet(PropertyInfo property)
- {
- return mapping.Attributes.IsSpecified(propertyMappings.Get(property));
- }
-
- #endregion
-
- #region Alteration
-
- private bool nextBool = true;
-
- void IInsertAlteration.Insert()
- {
- mapping.Insert = nextBool;
- nextBool = true;
- }
-
- void IUpdateAlteration.Update()
- {
- mapping.Update = nextBool;
- nextBool = true;
- }
-
- void IReadOnlyAlteration.ReadOnly()
- {
- mapping.Insert = mapping.Update = nextBool;
- nextBool = true;
- }
-
- void INullableAlteration.Nullable()
- {
- foreach (var column in mapping.Columns)
- column.NotNull = !nextBool;
-
- nextBool = true;
- }
-
- IAccessStrategyBuilder IAccessAlteration.Access
- {
- get { return new AccessMappingAlteration(mapping); }
- }
-
- void IPropertyAlteration.CustomTypeIs<T>()
- {
- mapping.Type = new TypeReference(typeof(T));
- }
-
- void IPropertyAlteration.CustomTypeIs(TypeReference type)
- {
- mapping.Type = type;
- }
-
- void IPropertyAlteration.CustomTypeIs(Type type)
- {
- mapping.Type = new TypeReference(type);
- }
-
- void IPropertyAlteration.CustomTypeIs(string type)
- {
- mapping.Type = new TypeReference(type);
- }
-
- void IPropertyAlteration.CustomSqlTypeIs(string sqlType)
- {
- foreach (var column in mapping.Columns)
- column.SqlType = sqlType;
- }
-
- void IPropertyAlteration.Unique()
- {
- foreach (var column in mapping.Columns)
- column.Unique = nextBool;
-
- nextBool = true;
- }
-
- void IPropertyAlteration.UniqueKey(string keyName)
- {
- foreach (var column in mapping.Columns)
- column.UniqueKey = keyName;
- }
-
- IPropertyAlteration IPropertyAlteration.Not
- {
- get
- {
- nextBool = !nextBool;
- return this;
- }
- }
-
- #endregion
- }
-}
View
150 src/FluentNHibernate/Conventions/DslImplementation/PropertyInspector.cs
@@ -0,0 +1,150 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using FluentNHibernate.Conventions.Inspections;
+using FluentNHibernate.MappingModel;
+
+namespace FluentNHibernate.Conventions.DslImplementation
+{
+ public class PropertyInspector : IPropertyInspector
+ {
+ private readonly InspectorModelMapper<IPropertyInspector, PropertyMapping> propertyMappings = new InspectorModelMapper<IPropertyInspector, PropertyMapping>();
+ private readonly PropertyMapping mapping;
+
+ public PropertyInspector(PropertyMapping mapping)
+ {
+ this.mapping = mapping;
+
+ propertyMappings.Map(x => x.Insert, x => x.Insert);
+ propertyMappings.Map(x => x.Update, x => x.Update);
+ propertyMappings.Map(x => x.Type, x => x.Type);
+ propertyMappings.Map(x => x.Access, x => x.Access);
+ propertyMappings.Map(x => x.EntityType, x => x.ContainingEntityType);
+ propertyMappings.Map(x => x.Formula, x => x.Formula);
+ propertyMappings.Map(x => x.Name, x => x.Name);
+ propertyMappings.Map(x => x.OptimisticLock, x => x.OptimisticLock);
+ propertyMappings.Map(x => x.Generated, x => x.Generated);
+ }
+
+ public bool Insert
+ {
+ get { return mapping.Insert; }
+ }
+
+ public bool Update
+ {
+ get { return mapping.Update; }
+ }
+
+ public int Length
+ {
+ get { return GetValueFromColumns<int>(x => x.Length); }
+ }
+
+ public bool Nullable
+ {
+ get { return !GetValueFromColumns<bool>(x => x.NotNull); }
+ }
+
+ public string Formula
+ {
+ get { return mapping.Formula; }
+ }
+
+ public TypeReference Type
+ {
+ get { return mapping.Type; }
+ }
+
+ public string SqlType
+ {
+ get { return GetValueFromColumns<string>(x => x.SqlType); }
+ }
+
+ public bool Unique
+ {
+ get { return GetValueFromColumns<bool>(x => x.Unique); }
+ }
+
+ public string UniqueKey
+ {
+ get { return GetValueFromColumns<string>(x => x.UniqueKey); }
+ }
+
+ public string Name
+ {
+ get { return mapping.Name; }
+ }
+
+ public bool OptimisticLock
+ {
+ get { return mapping.OptimisticLock; }
+ }
+
+ public string Generated
+ {
+ get { return mapping.Generated; }
+ }
+
+ public IEnumerable<IColumnInspector> Columns
+ {
+ get
+ {
+ foreach (var column in mapping.Columns)
+ yield return new ColumnInspector(mapping.ContainingEntityType, column);
+ }
+ }
+
+ public Access Access
+ {
+ get
+ {
+ if (mapping.Attributes.IsSpecified(x => x.Access))
+ return Access.FromString(mapping.Access);
+
+ return Access.Unset;
+ }
+ }
+
+ public Type EntityType
+ {
+ get { return mapping.ContainingEntityType; }
+ }
+
+ public string StringIdentifierForModel
+ {
+ get { return mapping.Name; }
+ }
+
+ public bool ReadOnly
+ {
+ get { return mapping.Insert && mapping.Update; }
+ }
+
+ public PropertyInfo Property
+ {
+ get { return mapping.PropertyInfo; }
+ }
+
+ public bool IsSet(PropertyInfo property)
+ {
+ return mapping.Attributes.IsSpecified(propertyMappings.Get(property));
+ }
+
+ /// <summary>
+ /// Gets the requested value off the first column, as all columns are (currently) created equal
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+ /// <returns></returns>
+ private T GetValueFromColumns<T>(Func<ColumnMapping, object> property)
+ {
+ var column = mapping.Columns.FirstOrDefault();
+
+ if (column != null)
+ return (T)property(column);
+
+ return default(T);
+ }
+ }
+}
View
93 src/FluentNHibernate/Conventions/ForeignKeyConvention.cs
@@ -1,52 +1,53 @@
using System;
using System.Reflection;
-using FluentNHibernate.Mapping;
+using FluentNHibernate.Conventions.AcceptanceCriteria;
+using FluentNHibernate.Conventions.Alterations;
+using FluentNHibernate.Conventions.Inspections;
namespace FluentNHibernate.Conventions
{
- //public abstract class ForeignKeyConvention : IReferenceConvention, IHasManyConvention, IHasManyToManyConvention
- //{
- // private bool acceptParent = true;
- // private bool acceptChild = true;
-
- // protected abstract string GetKeyName(PropertyInfo property, Type type);
-
- // public bool Accept(IManyToOnePart target)
- // {
- // return string.IsNullOrEmpty(target.GetColumnName());
- // }
-
- // public void Apply(IManyToOnePart target)
- // {
- // target.ColumnName(GetKeyName(target.Property, target.Property.PropertyType));
- // }
-
- // public bool Accept(IOneToManyPart target)
- // {
- // return target.KeyColumnNames.List().Count == 0;
- // }
-
- // public void Apply(IOneToManyPart target)
- // {
- // target.KeyColumnNames.Clear();
- // target.KeyColumnNames.Add(GetKeyName(null, target.EntityType));
- // }
-
- // public bool Accept(IManyToManyPart target)
- // {
- // acceptParent = string.IsNullOrEmpty(target.ParentKeyColumn);
- // acceptChild = string.IsNullOrEmpty(target.ChildKeyColumn);
-
- // return acceptParent || acceptChild;
- // }
-
- // public void Apply(IManyToManyPart target)
- // {
- // if (acceptParent && target.EntityType != null)
- // target.WithParentKeyColumn(GetKeyName(null, target.EntityType));
-
- // if (acceptChild && target.ChildType != null)
- // target.WithChildKeyColumn(GetKeyName(null, target.ChildType));
- // }
- //}
+ public abstract class ForeignKeyConvention : IReferenceConvention, IHasManyConvention, IHasManyToManyConvention
+ {
+ protected abstract string GetKeyName(PropertyInfo property, Type type);
+
+ public void Accept(IAcceptanceCriteria<IManyToOneInspector> acceptance)
+ {
+ acceptance.Expect(x => x.Columns.IsEmpty());
+ }
+
+ public void Apply(IManyToOneAlteration alteration, IManyToOneInspector inspector)
+ {
+ var columnName = GetKeyName(inspector.Property, inspector.Class);
+
+ alteration.ColumnName(columnName);
+ }
+
+ public void Accept(IAcceptanceCriteria<IOneToManyInspector> acceptance)
+ {
+ acceptance.Expect(x => x.KeyColumns.IsEmpty());
+ }
+
+ public void Apply(IOneToManyAlteration alteration, IOneToManyInspector inspector)
+ {
+ var columnName = GetKeyName(null, inspector.EntityType);
+
+ alteration.KeyColumnName(columnName);
+ }
+
+ public void Accept(IAcceptanceCriteria<IManyToManyInspector> acceptance)
+ {
+ acceptance.Expect(x => x.ParentKeyColumns.IsEmpty() || x.ChildKeyColumns.IsEmpty());
+ }
+
+ public void Apply(IManyToManyAlteration alteration, IManyToManyInspector inspector)
+ {
+ var columnName = GetKeyName(null, inspector.EntityType);
+
+ if (inspector.ParentKeyColumns.IsEmpty())
+ alteration.ParentKeyColumn(columnName);
+
+ if (inspector.ChildKeyColumns.IsEmpty())
+ alteration.ChildKeyColumn(columnName);
+ }
+ }
}
View
8 src/FluentNHibernate/Conventions/IColumnConvention.cs
@@ -0,0 +1,8 @@
+using FluentNHibernate.Conventions.Alterations;
+using FluentNHibernate.Conventions.Inspections;
+
+namespace FluentNHibernate.Conventions
+{
+ public interface IColumnConvention : IConvention<IColumnInspector, IColumnAlteration>
+ {}
+}
View
13 src/FluentNHibernate/Conventions/IHasManyConvention.cs
@@ -1,10 +1,11 @@
-using FluentNHibernate.Mapping;
+using FluentNHibernate.Conventions.Alterations;
+using FluentNHibernate.Conventions.Inspections;
namespace FluentNHibernate.Conventions
{
- ///// <summary>
- ///// HasMany convention, used for applying changes to one-to-many relationships.
- ///// </summary>
- //public interface IHasManyConvention : IConvention<IOneToManyPart>
- //{}
+ /// <summary>
+ /// HasMany convention, used for applying changes to one-to-many relationships.
+ /// </summary>
+ public interface IHasManyConvention : IConvention<IOneToManyInspector, IOneToManyAlteration>
+ { }
}
View
13 src/FluentNHibernate/Conventions/IHasManyToManyConvention.cs
@@ -1,10 +1,11 @@
-using FluentNHibernate.Mapping;
+using FluentNHibernate.Conventions.Alterations;
+using FluentNHibernate.Conventions.Inspections;
namespace FluentNHibernate.Conventions
{
- ///// <summary>
- ///// HasManyToMany convention, used on many-to-many relationships.
- ///// </summary>
- //public interface IHasManyToManyConvention : IConvention<IManyToManyPart>
- //{}
+ /// <summary>
+ /// HasManyToMany convention, used on many-to-many relationships.
+ /// </summary>
+ public interface IHasManyToManyConvention : IConvention<IManyToManyInspector, IManyToManyAlteration>
+ { }
}
View
1 src/FluentNHibernate/Conventions/IPropertyConvention.cs
@@ -1,6 +1,5 @@
using FluentNHibernate.Conventions.Alterations;
using FluentNHibernate.Conventions.Inspections;
-using FluentNHibernate.Mapping;
namespace FluentNHibernate.Conventions
{
View
14 src/FluentNHibernate/Conventions/IReferenceConvention.cs
@@ -1,11 +1,13 @@
+using FluentNHibernate.Conventions.Alterations;
+using FluentNHibernate.Conventions.Inspections;
using FluentNHibernate.Mapping;
namespace FluentNHibernate.Conventions
{
- ///// <summary>
- ///// Reference convention, implement this interface to apply changes to Reference/many-to-one
- ///// relationships.
- ///// </summary>
- //public interface IReferenceConvention : IConvention<IManyToOnePart>
- //{}
+ /// <summary>
+ /// Reference convention, implement this interface to apply changes to Reference/many-to-one
+ /// relationships.
+ /// </summary>
+ public interface IReferenceConvention : IConvention<IManyToOneInspector, IManyToOneAlteration>
+ { }
}
View
7 src/FluentNHibernate/Conventions/Inspections/Cascade.cs
@@ -0,0 +1,7 @@
+namespace FluentNHibernate.Conventions.Inspections
+{
+ public class Cascade
+ {
+
+ }
+}
View
7 src/FluentNHibernate/Conventions/Inspections/IAccessInspector.cs
@@ -0,0 +1,7 @@
+namespace FluentNHibernate.Conventions.Inspections
+{
+ public interface IAccessInspector
+ {
+ Access Access { get; }
+ }
+}
View
7 src/FluentNHibernate/Conventions/Inspections/ICascadeInspector.cs
@@ -0,0 +1,7 @@
+namespace FluentNHibernate.Conventions.Inspections
+{
+ public interface ICascadeInspector
+ {
+ Cascade Cascade { get; }
+ }
+}
View
10 src/FluentNHibernate/Conventions/Inspections/IManyToManyInspector.cs
@@ -0,0 +1,10 @@
+using System.Collections.Generic;
+
+namespace FluentNHibernate.Conventions.Inspections
+{
+ public interface IManyToManyInspector : IInspector
+ {
+ IEnumerable<IColumnInspector> ParentKeyColumns { get; }
+ IEnumerable<IColumnInspector> ChildKeyColumns { get; }
+ }
+}
View
12 src/FluentNHibernate/Conventions/Inspections/IManyToOneInspector.cs
@@ -0,0 +1,12 @@
+using System.Collections.Generic;
+using FluentNHibernate.MappingModel;
+
+namespace FluentNHibernate.Conventions.Inspections
+{
+ public interface IManyToOneInspector : IAccessInspector, ICascadeInspector, IOuterJoinInspector, IExposedThroughPropertyInspector
+ {
+ string Name { get; }
+ TypeReference Class { get; }
+ IEnumerable<IColumnInspector> Columns { get; }
+ }
+}
View
9 src/FluentNHibernate/Conventions/Inspections/IOneToManyInspector.cs
@@ -0,0 +1,9 @@
+using System.Collections.Generic;
+
+namespace FluentNHibernate.Conventions.Inspections
+{
+ public interface IOneToManyInspector : IInspector
+ {
+ IEnumerable<IColumnInspector> KeyColumns { get; }
+ }
+}
View
7 src/FluentNHibernate/Conventions/Inspections/IOuterJoinInspector.cs
@@ -0,0 +1,7 @@
+namespace FluentNHibernate.Conventions.Inspections
+{
+ public interface IOuterJoinInspector
+ {
+ OuterJoin OuterJoin { get; }
+ }
+}
View
3 src/FluentNHibernate/Conventions/Inspections/IPropertyInspector.cs
@@ -4,7 +4,7 @@
namespace FluentNHibernate.Conventions.Inspections
{
- public interface IPropertyInspector : IReadOnlyInspector, IExposedThroughPropertyInspector
+ public interface IPropertyInspector : IReadOnlyInspector, IExposedThroughPropertyInspector, IAccessInspector
{
bool Insert { get; }
bool Update { get; }
@@ -15,7 +15,6 @@ public interface IPropertyInspector : IReadOnlyInspector, IExposedThroughPropert
string SqlType { get; }
bool Unique { get; }
string UniqueKey { get; }
- Access Access { get; }
string Name { get; }
bool OptimisticLock { get; }
string Generated { get; }
View
7 src/FluentNHibernate/Conventions/Inspections/OuterJoin.cs
@@ -0,0 +1,7 @@
+namespace FluentNHibernate.Conventions.Inspections
+{
+ public class OuterJoin
+ {
+
+ }
+}
View
21 src/FluentNHibernate/FluentNHibernate.csproj
@@ -78,7 +78,24 @@
<Compile Include="Conventions\AcceptanceCriteria\CollectionExpectation.cs" />
<Compile Include="Conventions\AcceptanceCriteria\InvertedExpectation.cs" />
<Compile Include="Conventions\AcceptanceCriteria\InverterAcceptanceCriteria.cs" />
+ <Compile Include="Conventions\Alterations\IManyToManyAlteration.cs" />
+ <Compile Include="Conventions\Alterations\IManyToOneAlteration.cs" />
+ <Compile Include="Conventions\Alterations\IOneToManyAlteration.cs" />
+ <Compile Include="Conventions\DslImplementation\ColumnInspector.cs" />
+ <Compile Include="Conventions\DslImplementation\ManyToOneAlteration.cs" />
+ <Compile Include="Conventions\DslImplementation\ManyToOneInspector.cs" />
+ <Compile Include="Conventions\DslImplementation\PropertyInspector.cs" />
<Compile Include="Conventions\EnumerableExtensionsForConventions.cs" />
+ <Compile Include="Conventions\Alterations\IColumnAlteration.cs" />
+ <Compile Include="Conventions\IColumnConvention.cs" />
+ <Compile Include="Conventions\Inspections\Cascade.cs" />
+ <Compile Include="Conventions\Inspections\IAccessInspector.cs" />
+ <Compile Include="Conventions\Inspections\ICascadeInspector.cs" />
+ <Compile Include="Conventions\Inspections\IManyToManyInspector.cs" />
+ <Compile Include="Conventions\Inspections\IManyToOneInspector.cs" />
+ <Compile Include="Conventions\Inspections\IOneToManyInspector.cs" />
+ <Compile Include="Conventions\Inspections\IOuterJoinInspector.cs" />
+ <Compile Include="Conventions\Inspections\OuterJoin.cs" />
<Compile Include="MappingModel\TypeReference.cs" />
<Compile Include="Utils\Reflection\ExpressionBuilder.cs" />
<Compile Include="AutoMap\IAutoMapper.cs" />
@@ -126,7 +143,7 @@
<Compile Include="Conventions\ConventionVisitor.cs" />
<Compile Include="Conventions\DslImplementation\AccessMappingAlteration.cs" />
<Compile Include="Conventions\DslImplementation\ClassDsl.cs" />
- <Compile Include="Conventions\DslImplementation\ColumnDsl.cs" />
+ <Compile Include="Conventions\DslImplementation\ColumnAlteration.cs" />
<Compile Include="Conventions\DslImplementation\InspectorModelMapper.cs" />
<Compile Include="Conventions\DslImplementation\UnmappedPropertyException.cs" />
<Compile Include="Conventions\Inspections\Access.cs" />
@@ -149,7 +166,7 @@
<Compile Include="Conventions\AcceptanceCriteria\Is.cs" />
<Compile Include="Conventions\Inspections\IReadOnlyInspector.cs" />
<Compile Include="Conventions\Inspections\OptimisticLock.cs" />
- <Compile Include="Conventions\DslImplementation\PropertyDsl.cs" />
+ <Compile Include="Conventions\DslImplementation\PropertyAlteration.cs" />
<Compile Include="Conventions\AcceptanceCriteria\SetCriterion.cs" />
<Compile Include="Conventions\ConventionsCollection.cs" />
<Compile Include="Conventions\Defaults\DefaultForeignKeyConvention.cs" />
View
7 src/FluentNHibernate/Mapping/ManyToOnePart.cs
@@ -39,7 +39,7 @@ public class ManyToOnePart<TOther> : IManyToOnePart, IAccessStrategy<ManyToOnePa
private readonly CascadeExpression<IManyToOnePart> cascade;
private readonly IList<string> columns = new List<string>();
private bool nextBool = true;
- private readonly ManyToOneMapping mapping = new ManyToOneMapping();