title: Nhibernate schema Export
body: <p>I created a database in my SQL Server and I want to export the schema using Nhibernate in C#. I have two classes called <code>Customer</code> and <code>Address</code>.</p>
  
  <p><strong>customer.cs:</strong></p>
  
  <pre><code>public class Customer
  {
      public int ID {get; set;}
  
      public Address Address1 { get; set; }
  
      public Address Address2 { get; set; }
  }
  </code></pre>
  
  <p><strong>Address.cs:</strong></p>
  
  <pre><code>public class Address
  {
      public string City{get;set;}
  
      public string Postcode{get;set;}
  }
  </code></pre>
  
  <p>And I have written <code>customer.hbm.xml</code>. In that I defined addresses as <code>Component</code>:</p>
  
  <pre><code>&lt;component name="Address1" class="Address"&gt;
    &lt;property name="City" /&gt;
    &lt;property name="Postcode" /&gt;
  &lt;/component&gt;
  </code></pre>
  
  <p>How can I export the schema when my classes are like this?</p>