SimpleStringProperty(JavaFX)。反映TableColumn

时间:2015-08-08 14:26:02

标签: javafx tableview javafx-8

我有2.0.1-development

的以下声明
TableColumn

FaAccount如下

@FXML
private TableColumn<FaAccount, String> tc_account;

public class FaAccount { private Account account; ...//getters } 类依次是sql表的映射。在Account课程内,我有Account关系

one to one

通过调试我发现@JsonBackReference("account_benef") @OneToOne(fetch = FetchType.LAZY) @JoinColumn(name = "ResBenefID") @NotFound(action = NotFoundAction.IGNORE) private Account benefAccount; public Account getBenefAccount() { return benefAccount; } 充满了必要的条目。问题是我无法在JavaFx表中反映其值并且没有抛出异常,只是此列为空。我是这样做的:

benefAccount

如何更改上面的代码,以便tc_account.setCellValueFactory(cellData -> new SimpleStringProperty(cellData.getValue().getAccount().getBenefAccount().getNumber())); 反映在我的表格中?

0 个答案:

没有答案