Skip to content

Commit 63c7707

Browse files
committed
added an ability to specify column prefix when mapping a component from a field
1 parent 326bec3 commit 63c7707

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/FluentNHibernate/Mapping/ComponentPart.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public class ComponentPart<T> : ComponentPartBase<T, ComponentPart<T>>, ICompone
99
{
1010
private readonly Type entity;
1111
private readonly AttributeStore attributes;
12+
private string columnPrefix;
1213

1314
public ComponentPart(Type entity, Member property)
1415
: this(entity, property, new AttributeStore())
@@ -21,6 +22,11 @@ private ComponentPart(Type entity, Member property, AttributeStore attributes)
2122
this.entity = entity;
2223
}
2324

25+
public void ColumnPrefix(string prefix)
26+
{
27+
columnPrefix = prefix;
28+
}
29+
2430
/// <summary>
2531
/// Specify the lazy-load behaviour
2632
/// </summary>
@@ -40,9 +46,10 @@ protected override ComponentMapping CreateComponentMappingRoot(AttributeStore st
4046
{
4147
var componentMappingRoot = new ComponentMapping(ComponentType.Component, store)
4248
{
43-
ContainingEntityType = entity,
49+
ContainingEntityType = entity
4450
};
4551
componentMappingRoot.Set(x => x.Class, Layer.Defaults, new TypeReference(typeof(T)));
52+
componentMappingRoot.ColumnPrefix = columnPrefix;
4653
return componentMappingRoot;
4754
}
4855
}

0 commit comments

Comments
 (0)