Hello all,
How to map Struts tag s:checkboxlist by Hibernate?
For example, in the following I know company field in auth.hbm.xml is wrong. How do I correct this? Thanks!
Model:
String a[]={"browse","add","delete","update"};
boolean company[]=new boolean[a.length];
JSP:
<s:checkboxlist name="auth.company" list="%{auth.a}" key="company"/>
auth.hbm.xml:
<property name="company" type="int" not-null="true" />
MySql:
drop table if exists auth;
CREATE TABLE auth
(
id int unsigned not null auto_increment,
name text not null,
company int unsigned not null,
enabled boolean not null default true,
PRIMARY KEY (id),
UNIQUE KEY id (id)
)type=innodb;