我有一个 POJO,它的客户性别值为布尔值。我必须以数据源为客户类型的形式制作一个组合框。如何使组合框具有将绑定到布尔值的“男性”和“女性”选项。
谢谢。表格代码:
Form customerForm= new BeanValidationForm<Customer>(Customer.class);
客户 POJO:
public class Customer implements Serializable {
public static final String QUERY_ALL = "Customer.queryAll";
public static final String QUERY_BY_ID = "Customer.queryById";
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@Column(length = 50, nullable = false)
private String name;
@Column(length = 50, nullable = false)
private String surname;
@Column(nullable = false)
private Boolean gender;
//getters and setters....
}