WorldStarWB / rapid-framework

Automatically exported from code.google.com/p/rapid-framework
0 stars 0 forks source link

设置 unique 字段, 模板中判断不了 #59

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
我发现generator无法判断 mysql的 Unique 设置

模板中 <#if column.unique && !column.pk> 一直是false

unique index  或者  unique key 都判断不了

期待模板种能正常判断这个,因为生成getBy方法 需要判断

Original issue reported on code.google.com by azheng...@gmail.com on 26 Aug 2010 at 9:41

GoogleCodeExporter commented 8 years ago
create table user_info
(
   user_id              numeric(32) not null,
   login_account        varchar(32) not null,
   user_name            varchar(64) not null,
   first_name           varchar(32),
   last_name            varchar(32),
   login_pwd            varchar(128),
   login_email          varchar(256) not null,
   user_type            numeric(8),
   register_time        datetime,
   user_status          numeric(8),
   primary key (user_id),
   unique key AK_login_account (login_account),
   unique key AK_login_email (login_email)
);

create unique index Index_user_name on user_info
(
   user_name
);

/*以上都无法判断字段为 unique*/

Original comment by azheng...@gmail.com on 26 Aug 2010 at 9:43

GoogleCodeExporter commented 8 years ago
我这边是正常的,测试发现没有你所说的问题.

Original comment by bad...@gmail.com on 26 Aug 2010 at 2:31

GoogleCodeExporter commented 8 years ago
但是模板没有为我生成 getByLoginAccount()  和 getByLoginEmail() 
方法,这个我不好理解了

Original comment by azheng...@gmail.com on 31 Aug 2010 at 1:27

GoogleCodeExporter commented 8 years ago
我这为也是使用mysql,但没有发现你说的问题,你的mysql是什么
版本,我的是 5.1
存储引擎是 innodb

Original comment by bad...@gmail.com on 1 Sep 2010 at 8:06