title: Spring Data JPA (Hibernate) One to Many Relationship with Dynamic Condition
body: <p>I have a one to many relationship between two of my entites, <code>Airport</code> and <code>AirportTranslation</code>:</p>
  
  <pre><code>public class Airport {
      @Id
      @Column(name = "id")
      private Long id;
  
      @OneToMany(mappedBy="airport", fetch = FetchType.LAZY)
      private List&lt;AirportTranslation&gt; translations;
  }
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>public class AirportTranslation implements Serializable {
      @Id
      @Column(name = "id", updatable = false)
      private Long id;
  
      @ManyToOne(fetch = FetchType.LAZY)
      @JoinColumn(name = "airport_id")
      private Airport airport;
  
      @Column(name = "lang")
      private String lang;
  
      @Column(name = "name")
      private String name;    
  }
  </code></pre>
  
  <p>Now I want to get all translations of an airport based on the current language of the system, using the normal syntax: <code>airport.getTranslations()</code>.</p>
  
  <p>Due to the fact that the current language is dynamic, I can not use hibernate <code>@Where</code>.</p>
  
  <p>I think using Hibernate <code>@Filter</code> could be the best option, but I can't find any clean, working sample of that for spring boot applications.</p>