<h:outputLabel value="#{bundle.CreateCustomerLabel_email}" for="email" />
<h:inputText id="email" value="#{customerController.selected.email}" title="#{bundle.CreateCustomerTitle_email}" />
<h:outputLabel value="Address:" for="addressId.address" />
<h:inputText size="30" id="address" value="#{customerController.selected.addressId.address}" title="Address" >
</h:inputText>
在 Cutomer Entity bean 中,我有:
@JoinColumn(name = "address_id", referencedColumnName = "address_id")
@ManyToOne(optional = true, cascade={CascadeType.ALL})
private Address addressId;
在地址实体 bean 中,我有:
Basic(optional = true)
@NotNull
@Size(min = 1, max = 50)
@Column(name = "address")
private String address;
问题:如何在 JSF 2.0 表单中使用嵌套属性?我应该实现嵌套表单还是如何实现?
提前致谢!萨米人