2
I ended up finding a problem that I believe is trivial but I don’t know how to solve. I have a class Seller who has an association with another class: Department. And I need a Tableview that populates two columns with database data, the first being @FXML private TableColumn<Seller, String> sellerName and the second @FXML private TableColumn<Seller, String> departmentName and the Table view: @FXML private TableView<Seller> tableViewSeller.
The first column should be responsible for listing the names of all sellers (Seller) and the second column of their respective departments (Department), in an associated form. The problem is time to pass what he should put in the column of the department name, and in the class Sellerit has an association with Department and its builder receives a new Department("Exemplo");to instantiate a Seller. To access for example, the name of the department should be done Seller seller = new Seller(); seller.getDepartment().getName;. How do I get the second column popular with the respective department of a seller and there is nothing that can happen here departmentName.setCellValueFactory(new PropertyValueFactory<>("*****")); referencing an attribute of an association ?