title: How to retrieve data for a JavaFX table from a JPA entity in relation with another one?
body: <p>I'm retrieving some data from multiple tables in JPA.
  Here's the first entity:</p>
  
  <pre><code>@Entity
  @Table(name = "source")
  public class Source implements Serializable {
      @Id
      @Column(name = "sourceid", nullable = false)
      private String sourceId;
      @ManyToOne
      @JoinTable(name = "flux")
      private Flux flux;
  
      // Other attributes
      // Constructors, getters and setters
  }
  </code></pre>
  
  <p>And here's the second entity, that is referenced from the first one:</p>
  
  <pre><code>@Entity
  @Table(name = "flux")
  public class Flux implements Serializable {
      @EmbeddedId
      private FluxId fluxId = new FluxId();
      @Column(name = "value")
      private BigDecimal value;
      @Column(name = "error")
      private BigDecimal error;
  
      // Other attributes
      // Constructors, getters and setters
  }
  </code></pre>
  
  <p>I want to display the data of these tables in a single JavaFX table. How to do that? Here's what I was trying to do, but the columns of <code>flux.value</code> and <code>flux.error</code> are always empty. How to fix this?</p>
  
  <pre><code>// Source table setup
      sourceIdColumn.setCellValueFactory(new PropertyValueFactory&lt;&gt;("sourceId"));
      fluxColumn.setCellValueFactory(new PropertyValueFactory&lt;&gt;("flux.value")); // Value of the flux
      errorColumn.setCellValueFactory(new PropertyValueFactory&lt;&gt;("flux.error")); // Error of the flux
      // More columns definition from sources attributes
  </code></pre>