title: How to create a hibernate order with properties in another table?
body: <p>I'm trying to create an order on a table and one of the items to be 'ordered by' happens to be a property that's in the <strong>one end</strong> of the relationship.
  Do I specify the property by the <strong>name of the key</strong>, the <strong>name of the property</strong> (in the foreign table) or the <strong>name of the table?</strong>
  Currently have:
  <code>order =  new Order[]{Order.asc("lastControlDate"), Order.asc("idManufacturer"), Order.asc("model")};</code> where in <em>idManufacturer</em> is the foreign key
  Thanks</p>
  
  <p>The entities are  <strong>Manufacturer</strong> <em>1..M</em> <strong>Car</strong> wherein: </p>
  
  <p>Manufacturer:</p>
  
  <pre><code>public class Manufacturer{
      private Long idManufacturer;
      private String name;
  
  //&lt;editor-fold defaultstate="collapsed" desc="Constructors"&gt;
  public Manufacturer(){
  //getters and setters....
  
  }
  </code></pre>
  
  <p>Car:</p>
  
  <pre><code>public class Car {
  private long idCar;
  private String model;
  private Manufacturer manufacturer;
  //Constructor, getters and setters...
  }
  </code></pre>
  
  <p>order = new Order[]{ Order.desc("manufacturer"), Order.desc("model")};</p>
  
  <pre><code>public static List&lt;Car&gt; listCarsByManufacturer(Manufacturer name, Order...orders)throws Exception{
          LinkedList&lt;Criterion&gt; criterions = new LinkedList&lt;Criterion&gt;();
          criterions.add(Restrictions.like("Car.manufacturer", name));
  
          List&lt;Car&gt; cars =carDAO.findAllCars(criterions, orders);
          return cars;
  }
  </code></pre>