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

housing 字段 sql生成java 转换丢失 #155

Open
wubiaoo opened this issue May 16, 2024 · 1 comment
Open

housing 字段 sql生成java 转换丢失 #155

wubiaoo opened this issue May 16, 2024 · 1 comment

Comments

@wubiaoo
Copy link

wubiaoo commented May 16, 2024

输入SQL
CREATE TABLE test (
id varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
housing char(1) NULL DEFAULT NULL COMMENT '',
PRIMARY KEY (id) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;

输出代码
public class Test implements Serializable {

private static final long serialVersionUID = 1L;

/**
* id
*/
private String id;


public Test() {
}

public String getId() {
    return id;
}

public void setId(String id) {
    this.id = id;
}

}

@willxiang
Copy link
Contributor

willxiang commented Sep 4, 2024

看了下源码,问题在这个方法中的这段代码:
com.softdev.system.generator.util.TableParseUtil#processTableIntoClassInfo

image

本地测试把这个判断去掉后(或将代码中using两边增加空格),可以正常生成 housing 或 housing_* 的字段了

说明:我截图的代码并非主分支最新代码,因为我本地用的jdk8。

提了一个PR:
#157

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