I am currently using JavaFX to display data from a SQL Server database. I have created a TableView based on the contents of one table in the database. The database table is a collection of Products, so the TableView declaration is:
@FXML
private TableView<Products> productTable;
And each row in the TableView is declared something like this:
@FXML
private TableColumn<Products, String> productName;
Each column has a ValueFactory which contains a PropertyValueFactory which maps the data from the database to the column. Now what I'd really like to do is have my table contain data from 2 database tables, since there is a one-to-one relationship between the product and a cost table. However, I haven't found a clever way to do this yet.
Anyone have any suggestions or idea?