title: fluent-nhibernate Mapping HasOne? Reference?
body: <p>Not sure how I should map this. I have two tables </p>
  
  <p><strong>Week with the columns</strong></p>
  
  <p>Id, SeasionId, WeekStarts, MatchOfTheWeek</p>
  
  <p><strong>Matches with the columns</strong></p>
  
  <p>Id, Location, MatchDate, Rounds</p>
  
  <p>my Weeks classhas a object of type Match</p>
  
  <pre><code>    public virtual Match MatchOfTheWeek
      {
          get;
          set;
      }
  </code></pre>
  
  <p>Now I have mapping on my Match</p>
  
  <pre><code>    public MatchMapping()
      {
          Id(x =&gt; x.Id);
          Map(x =&gt; x.Location);
          Map(x =&gt; x.Rounds);
          Map(x =&gt; x.MatchDate).Nullable();
          HasManyToMany(x =&gt; x.Boxers)
              .Table("Boxer_Match")
              .ParentKeyColumn("matchid")
              .ChildKeyColumn("boxerid")
              .AsSet()
              .Cascade.SaveUpdate();
          HasOne(x =&gt; x.Result)
              .Cascade.Delete();
      }
  </code></pre>
  
  <p>and my Week mappings </p>
  
  <pre><code>    public WeekMapping()
      {
          Id(x =&gt; x.Id);
          References(x =&gt; x.Season);
          HasMany(x =&gt; x.Predictions).Cascade.SaveUpdate().Inverse();
          HasOne(x =&gt; x.MatchOfTheWeek).ForeignKey("MatchOfTheWeek");
          //References(x =&gt; x.MatchOfTheWeek).Nullable();
          HasManyToMany(x =&gt; x.Matches)
              .Table("WeekMatch")
              .ParentKeyColumn("WeekID")
              .ChildKeyColumn("MatchId")
              .AsSet()
              .Cascade.All();
          Map(x =&gt; x.WeekStarts);
      }
  </code></pre>
  
  <p>Bascially As the Weekmapping is shown there it errors. If i swap out the HasOne to replace it with the commented line which is a Reference. then it doesn't error but returns a null</p>
  
  <p>What have i done wrong here?</p>