title: ORMLite - Query foreign field
body: <p>Using ORMLite for Android, I need to build a query that returns orders by order id or by customer name. Please consider the following class declarations:</p>
  
  <pre><code>@DatabaseTable(tableName = "order")
  public class Order {
      @DatabaseField(generatedId = true)
      private Long id;
  
      @DatabaseField(foreign = true, canBeNull = false, foreignAutoRefresh = true, columnName = "customer_id")
      private Customer customer;
  
      // default constructor, getters and setters...
  }
  
  @DatabaseTable(tableName = "customer")
  public class Customer {
      @DatabaseField(generatedId = true)
      private Long id;
  
      @DatabaseField
      private String name;
  
      // default constructor, getters and setters...
  }
  </code></pre>
  
  <p>The raw SQL I'm looking for would be something like this:</p>
  
  <pre><code>SELECT 
      o.* 
  FROM
      order o
      JOIN customer c on
          o.customer_id = c.id
  WHERE
      (o.id = ?) OR (c.name = ?)
  </code></pre>
  
  <p>What is the best way to do this using ORMLite?</p>