title: Hibernation simple direct mapping
body: <p>I have 2 tables employees and orders: <a href="http://imageshack.us/g/689/screenshotfrom201306021v.png/" rel="nofollow">Console screens_before execusion</a>
  Now i'm trying to map list collection to get all orders of each employee. My mapping:</p>
  
  <pre><code>@Entity
  @Table(name = "employees", schema = "public")
  public class Employees implements java.io.Serializable {
  
           /**
            *
            */
           private static final long serialVersionUID = 1885071569771542035L;
           private short employeeid;
           //...
  
           private List&lt;Orders&gt; ordersList;
           @OneToMany(mappedBy = "employees")
           public List&lt;Orders&gt; getOrders() {
                   return ordersList;
           }
  
           public void setOrders(List&lt;Orders&gt; orders) {
                   this.ordersList = orders;
           }
  </code></pre>
  
  <p>.</p>
  
  <pre><code>@Entity
  @Table(name = "orders", schema = "public")
  public class Orders implements java.io.Serializable {
  
           /**
            *
            */
           private static final long serialVersionUID = 405644896073449066L;
  
           private short orderid;
           //...
  
           private Employees employees;
  
           @ManyToOne
           public Employees getEmployees() {
                   return employees;
           }
  
           public void setEmployees(Employees employees) {
                   this.employees = employees;
           }
  
           public Orders() {
           }
  
           public Orders(short orderid) {
                   this.orderid = orderid;
           }
  </code></pre>
  
  <p>But unfortunately I'm getting none. I've been trying to detect sql queries to database, and i think hibernate creates new column: <a href="http://imageshack.us/photo/my-images/689/screenshotfrom201306021v.png/" rel="nofollow">sql result</a></p>
  
  <p>It probably need to refer to:</p>
  
  <pre><code>orders0_.employeeid as employeeid1_0_,
  </code></pre>
  
  <p>not to</p>
  
  <pre><code>orders0_.employees_employeeid as employees15_1_0_,
  </code></pre>
  
  <p>But I don't know how to force him to do it. (I'm using postgresql)</p>