title: Creating a Single Entity with @SecondaryTable makes full join instead of Inner join JPA hibernate
body: <p>I'm using the following code to collect data from two different tables, but it's giving me records from the meal table even if there are not any records in the allergies table but I want to do a INNER  JOIN from both tables instead. I don't want to get any records from the  meal table if I don't have any records in the allergies table that match the same id inside the meals table.
  Please advise I have been stock with this for days.</p>
  <pre><code>@Entity
  @Table(name = &quot;meal&quot;)
  @SecondaryTable(name = &quot;allergens&quot;, pkJoinColumns = @PrimaryKeyJoinColumn(name = &quot;meal_id&quot;))
  class Meal {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = &quot;id&quot;)
      Long id;
  
      @Column(name = &quot;name&quot;)
      String name;
  
      @Column(name = &quot;description&quot;)
      String description;
  
      @Column(name = &quot;price&quot;)
      BigDecimal price;
  
      @Column(name = &quot;peanuts&quot;, table = &quot;allergens&quot;)
      boolean peanuts;
  
      @Column(name = &quot;celery&quot;, table = &quot;allergens&quot;)
      boolean celery;
  
      @Column(name = &quot;sesame_seeds&quot;, table = &quot;allergens&quot;)
      boolean sesameSeeds;
  
      // standard getters and setters
  
  }
  </code></pre>