Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Property Formula mapping override fix #168

Open
wants to merge 1 commit into from

4 participants

@alberto-chiesa

Fix Property.Formula mapping override: if a Formula is specified, the Columns collection should be ignored.

Without this, if I use automap+overrides, the property will already have a Column property set, and it will not be possible to overcome this.

@gianos gianos Fix Formula mapping override: if a Formula is specified, the Columns …
…collection should be ignored.

Without this, if I use automap+overrides, the property will already have a Column property set, and it will not be possible to overcome this.
de2187f
@jagregory
Owner

Any chance of getting some tests for this? I don't like making changes without some tests to back it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 25, 2012
  1. @gianos

    Fix Formula mapping override: if a Formula is specified, the Columns …

    gianos authored
    …collection should be ignored.
    
    Without this, if I use automap+overrides, the property will already have a Column property set, and it will not be possible to overcome this.
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/FluentNHibernate/MappingModel/PropertyMapping.cs
View
7 src/FluentNHibernate/MappingModel/PropertyMapping.cs
@@ -20,8 +20,11 @@ public override void AcceptVisitor(IMappingModelVisitor visitor)
{
visitor.ProcessProperty(this);
- foreach (var column in Columns)
- visitor.Visit(column);
+ if (String.IsNullOrEmpty(this.Formula))
+ {
+ foreach (var column in Columns)
+ visitor.Visit(column);
+ }
}
public Type ContainingEntityType { get; set; }
Something went wrong with that request. Please try again.