title: NHibernate mapping an entity without a primary key
body: <p>My Entity has no primary key for some reasons:</p>
  
  <pre><code>public partial class VehicleLocation
  {
      public virtual string UserCode { get; set; }
      public virtual string DateTime { get; set; }
      public virtual string Device { get; set; }
      public virtual string Gps { get; set; }
      public virtual string GpsDateTime { get; set; }
      public virtual double Speed { get; set; }
  }
  </code></pre>
  
  <p>The mapping:</p>
  
  <pre><code>class VehicleLoactionMap : ClassMap&lt;VehicleLocation&gt; 
  {
      public VehicleLoactionMap()
      {
          Table("VEHICLE_LOCATION");
          LazyLoad();
          Map(x =&gt; x.UserCode).Column("USER_CODE");
          Map(x =&gt; x.DateTime).Column("DATE_TIME");
          Map(x =&gt; x.Device).Column("DEVICE");
          Map(x =&gt; x.Gps).Column("GPS");
          Map(x =&gt; x.GpsDateTime).Column("GPS_DATE_TIME");
          Map(x =&gt; x.Speed).Column("SPEED");
      }
  }
  </code></pre>
  
  <p>I got this error: </p>
  
  <blockquote>
    <p>The entity 'VehicleLocation' doesn't have an Id mapped...</p>
  </blockquote>
  
  <p>How can I map my entity without using a primary key?</p>