TableView a relacja w bazie danych

0

|==========| |==========|
| Expenses | | Allocations |
|==========| |==========|
+ ID +ID
+ Date +Type
+ Amount ===========
+ Allocations

Chcąc uzupełnić TableView z wynikami tabeli Expenses, w jaki sposób mógłbym w miejsce Allocations wstawić Type(gdzie Type jest Stringiem).

Z marnym skutkiem wypociłem taki niedziałający bzik:

 @FXML
    private TableView tableView;

    @FXML
    private TableColumn<ExpenseView, String> dateColumn;

    @FXML
    private TableColumn<ExpenseView, Integer> amountColumn;

    @FXML
    private TableColumn<AllocationView, String> sourceAndAllocationColumn;


public void initialize(){
        ExpensesManager.queryForAll();
        tableView.setItems(ExpensesManager.getExpensesObservableList());
        dateColumn.setCellValueFactory(cell -> cell.getValue().dateProperty());
        amountColumn.setCellValueFactory(cell -> cell.getValue().amountProperty().asObject());
        sourceAndAllocationColumn.setCellValueFactory(cell -> cell.getValue().typeProperty());
    }

0

o jaaa, chciałem dobrze a wyszło jak zwykle badziewnie. wszystko się rozjechało.
Tabela Expanses ma pola (ID, Date, Amount, Allocations), a Allocations z kolei (ID, Type).

1 użytkowników online, w tym zalogowanych: 0, gości: 1