title: Unable to create One to many mapping table in hibernate
body: <p>I am quite new to hibernate. I have created two entities like user and vehicle with user having one to many relationship with vehicle. </p>
  
  <pre><code>@OneToMany
  @JoinColumn(name="Vehicle_id")
  Collection&lt;Vehicle&gt; vehicle = new ArrayList&lt;&gt;();
  </code></pre>
  
  <p>and adding them to table like this </p>
  
  <pre><code>UserInfo user = new UserInfo();
  user.setUsername(username);
  user.setPassword(password);
  user.setDob(dob);
  
  Vehicle vehicle = new Vehicle();
  vehicle.setVehicleName("AUdi");
  user.getVehicle().add(vehicle);
  
  Vehicle vehicle2 = new Vehicle();
  vehicle2.setVehicleName("BMW");
  user.getVehicle().add(vehicle2);
  
  SessionFactory sessionfactory = new AnnotationConfiguration().configure().buildSessionFactory();
  Session session = sessionfactory.openSession();
  session.beginTransaction();
  session.save(user);
  session.save(vehicle);
  session.save(vehicle2);
  session.getTransaction().commit();
  session.close();
  </code></pre>
  
  <p>But I am getting result like </p>
  
  <pre><code>Hibernate: insert into UserInformation (user_name, DOB) values (?, ?)
  Hibernate: insert into Vehicle (vehicleName) values (?)
  Hibernate: insert into Vehicle (vehicleName) values (?)
  Hibernate: update Vehicle set Vehicle_id=? where vehicleID=?
  Hibernate: update Vehicle set Vehicle_id=? where vehicleID=?
  </code></pre>
  
  <p>There is no table created like </p>
  
  <pre><code>insert into User_vehicle(User_id,vehicle_id) Values (?,?)
  </code></pre>
  
  <p>So I am not getting any table name <code>User_vehicle</code> in db.</p>
  
  <p>Hope you understand my question.</p>