title: Changing the generated name of a foreign key in Hibernate
body: <pre><code>@OneToOne()
  @JoinColumn(name="vehicle_id", referencedColumnName="vehicleId")
  public Vehicle getVehicle() {
      return vehicle;
  }
  </code></pre>
  
  <p>My UserDetails class has a one-to-one mapping with the Entitity class Vehicle. <code>Hibernate</code> creates the 2 tables and assigns a generic Foreign Key, which maps the vehicle_id column (UserDetails table.) to the primary key vehicleId (Vehicle table).</p>
  
  <pre><code>KEY FKB7C889CEAF42C7A1 (vehicle_id),
  CONSTRAINT FKB7C889CEAF42C7A1 FOREIGN KEY (vehicle_id) REFERENCES vehicle (vehicleId)
  </code></pre>
  
  <p>My question is : how do we change this generated foreign key, into something meaningful, like Fk_userdetails_vehicle for example.</p>