Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于表t_user且表中有2个连续的default为‘’的字段和实体类为user,一键生成属性不全 #916

Open
txy0818 opened this issue Jun 2, 2024 · 1 comment

Comments

@txy0818
Copy link

txy0818 commented Jun 2, 2024

生成时出现,但我是新项目,什么都没生成过
[WARNING] Column id, specified as a generated key column in table t_user, does not exist in the table.
[WARNING] Column id, specified as a generated key column in table t_user, does not exist in the table.
[WARNING] Existing file F:\JavaWeb\generatetest2\src\main\java\com\atguigu\cloud\entities\User.java was overwritten
[WARNING] Existing file F:\JavaWeb\generatetest2\src\main\java\com\atguigu\cloud\mapper\UserMapper.java was overwritten
[WARNING] Existing file F:\JavaWeb\generatetest2\src\main\java\com\atguigu\cloud\entities\User.java was overwritten
[WARNING] Existing file F:\JavaWeb\generatetest2\src\main\java\com\atguigu\cloud\mapper\UserMapper.java was overwritten
[WARNING] Existing file F:\JavaWeb\generatetest2\src\main\java\com\atguigu\cloud\entities\User.java was overwritten
[WARNING] Existing file F:\JavaWeb\generatetest2\src\main\java\com\atguigu\cloud\mapper\UserMapper.java was overwritten

CREATE TABLE t_user (
id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
username VARCHAR(50) NOT NULL DEFAULT '' COMMENT '用户名',
password VARCHAR(50) NOT NULL DEFAULT '' COMMENT '密码',
sex TINYINT(4) NOT NULL DEFAULT '0' COMMENT '性别 0=女 1=男',
deleted TINYINT(4) UNSIGNED NOT NULL DEFAULT '0' COMMENT '删除标志,默认0不删除,1删除',
update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (id)
) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='用户表';

我的实体类中只有id,username,我尝试了targetRuntime="MyBatis3"和MyBatis3Simple都不行

我尝试其他表(t_pay)还是相同的属性,可以全部生成,且没有上面的warning

@abel533
Copy link
Owner

abel533 commented Jun 3, 2024

应该和默认值没关系。。可以debug看看获取的字段有没有问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants