title: Fluent Nhibernate 3 Mapping Composite Field (Custom Type)
body: <p>HI all, my scenario</p>
  
  <pre><code>public class Permission
  {
      public virtual Function Function { get; set; }
      public virtual Profile Profile { get; set; }
  }
  
  public class MapPermission : ClassMap&lt;Permission&gt;
  {
      public MapPermission()
      {
          Table("Permissions".ToUpper());
          CompositeId().KeyProperty(x =&gt; x.Function, "FunctionID").KeyProperty(x =&gt; x.Profile, "ProfileID");
  
      }
  }
  </code></pre>
  
  <p>Where Function AND Profile  are two easy mapped entities. When i Run i have this error:</p>
  
  <p>Could not determine type for: Data.Model.Entities.Function, Data.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, for columns: NHibernate.Mapping.Column(FunctionID)"}</p>
  
  <p>Is there a way to avoid this? ultimately i need to create a class with CompositeID made by two custom mapped classes. If i uses compositeID with int fields it works like a charm</p>
  
  <p>Thanks in Advance</p>
  
  <p>Function (Like Profile) Mapping</p>
  
  <pre><code>public class Function
  {
      public virtual int ID { get; set; }
      public virtual string Name { get; set; }
  }
  
  public class MapFunction : ClassMap&lt;Function&gt;
  {
      public MapFunction()
      {
          Table("FUNCTIONS");
          Id(x =&gt; x.ID);
          Map(x =&gt; x.Name);
      }
  }
  </code></pre>