{"id":36425906,"url":"https://github.com/supergaga/generator","last_synced_at":"2026-01-11T18:00:14.072Z","repository":{"id":57723437,"uuid":"230423488","full_name":"supergaga/generator","owner":"supergaga","description":"mybatis generator plugin  use table comment","archived":false,"fork":false,"pushed_at":"2021-06-09T02:51:58.000Z","size":44,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-07-01T00:04:52.451Z","etag":null,"topics":["java","mybatis-generator-plugins"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/supergaga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-27T10:25:06.000Z","updated_at":"2022-06-17T13:34:11.000Z","dependencies_parsed_at":"2022-08-28T15:33:39.135Z","dependency_job_id":null,"html_url":"https://github.com/supergaga/generator","commit_stats":null,"previous_names":[],"tags_count":1,"template":null,"template_full_name":null,"purl":"pkg:github/supergaga/generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supergaga%2Fgenerator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supergaga%2Fgenerator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supergaga%2Fgenerator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supergaga%2Fgenerator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/supergaga","download_url":"https://codeload.github.com/supergaga/generator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supergaga%2Fgenerator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28316876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T14:58:17.114Z","status":"ssl_error","status_checked_at":"2026-01-11T14:55:53.580Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","mybatis-generator-plugins"],"created_at":"2026-01-11T18:00:13.253Z","updated_at":"2026-01-11T18:00:14.043Z","avatar_url":"https://github.com/supergaga.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mybatis-generator-comment-plugin \n[![package](https://github.com/supergaga/generator/workflows/package/badge.svg)](https://github.com/supergaga/generator/actions)\n\nA plugin for [MyBatis Generator](http://mybatis.github.io/generator/)\nto use [Lombok](http://projectlombok.org/) annotations and table annotations\n\nreference [mybatis-generator-lombok-plugin](https://github.com/softwareloop/mybatis-generator-lombok-plugin)\n\nNOTE:\n这个demo项目里面生成的实体类的过程是使用注释生成的，现在看来很牵强，也很幼稚。如果你是初学者这个代码可以看看跑跑试试，没有太多的学习价值。\n这个项目推到远端，还有一个目的是测试GitHub Action的功能以及自动打包上传到maven中央仓库。 我觉得自动化这部分 可以参考下。\n2021年06月09日10:49:55\n\n\n数据库建表语句\n```mysql\nCREATE TABLE `user` (\n  `id` bigint(20) DEFAULT NULL COMMENT '自增id',\n  `name` varchar(255) DEFAULT NULL COMMENT '姓名',\n  `mobile` bigint(255) DEFAULT NULL COMMENT '手机号'\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户表';\n```\n\n默认生成的实体类\n```java\npackage entity;\n\npublic class User {\n    /**\n     *\n     * This field was generated by MyBatis Generator.\n     * This field corresponds to the database column user.id\n     *\n     * @mbg.generated Sun Feb 02 14:17:08 CST 2020\n     */\n    private Long id;\n\n    /**\n     *\n     * This field was generated by MyBatis Generator.\n     * This field corresponds to the database column user.name\n     *\n     * @mbg.generated Sun Feb 02 14:17:08 CST 2020\n     */\n    private String name;\n\n    /**\n     *\n     * This field was generated by MyBatis Generator.\n     * This field corresponds to the database column user.mobile\n     *\n     * @mbg.generated Sun Feb 02 14:17:08 CST 2020\n     */\n    private Long mobile;\n\n    /**\n     * This method was generated by MyBatis Generator.\n     * This method returns the value of the database column user.id\n     *\n     * @return the value of user.id\n     *\n     * @mbg.generated Sun Feb 02 14:17:08 CST 2020\n     */\n    public Long getId() {\n        return id;\n    }\n\n    /**\n     * This method was generated by MyBatis Generator.\n     * This method sets the value of the database column user.id\n     *\n     * @param id the value for user.id\n     *\n     * @mbg.generated Sun Feb 02 14:17:08 CST 2020\n     */\n    public void setId(Long id) {\n        this.id = id;\n    }\n\n    /**\n     * This method was generated by MyBatis Generator.\n     * This method returns the value of the database column user.name\n     *\n     * @return the value of user.name\n     *\n     * @mbg.generated Sun Feb 02 14:17:08 CST 2020\n     */\n    public String getName() {\n        return name;\n    }\n\n    /**\n     * This method was generated by MyBatis Generator.\n     * This method sets the value of the database column user.name\n     *\n     * @param name the value for user.name\n     *\n     * @mbg.generated Sun Feb 02 14:17:08 CST 2020\n     */\n    public void setName(String name) {\n        this.name = name;\n    }\n\n    /**\n     * This method was generated by MyBatis Generator.\n     * This method returns the value of the database column user.mobile\n     *\n     * @return the value of user.mobile\n     *\n     * @mbg.generated Sun Feb 02 14:17:08 CST 2020\n     */\n    public Long getMobile() {\n        return mobile;\n    }\n\n    /**\n     * This method was generated by MyBatis Generator.\n     * This method sets the value of the database column user.mobile\n     *\n     * @param mobile the value for user.mobile\n     *\n     * @mbg.generated Sun Feb 02 14:17:08 CST 2020\n     */\n    public void setMobile(Long mobile) {\n        this.mobile = mobile;\n    }\n}\n```\n使用插件后 生成\n```java\npackage entity;\n\nimport lombok.AllArgsConstructor;\nimport lombok.Builder;\nimport lombok.Data;\nimport lombok.NoArgsConstructor;\n\n/**\n * 用户表\n * @author   tsn\n * @date   2020-02-02\n */\n@Data\n@AllArgsConstructor\n@NoArgsConstructor\n@Builder(toBuilder = true)\npublic class User {\n    /**\n     * 自增id\n     */\n    private Long id;\n\n    /**\n     * 姓名\n     */\n    private String name;\n\n    /**\n     * 手机号\n     */\n    private Long mobile;\n}\n```\n\n\n## Using the plugin\npom 文件中引入\n```xml\n\u003cplugin\u003e\n    \u003cgroupId\u003eorg.mybatis.generator\u003c/groupId\u003e\n    \u003cartifactId\u003emybatis-generator-maven-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e${mybatis.generator.version}\u003c/version\u003e\n    \u003cconfiguration\u003e\n        \u003coverwrite\u003etrue\u003c/overwrite\u003e\n    \u003c/configuration\u003e\n    \u003cdependencies\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003ecom.github.supergaga\u003c/groupId\u003e\n            \u003cartifactId\u003egenerator\u003c/artifactId\u003e\n            \u003cversion\u003e1.0.0\u003c/version\u003e\n        \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n\u003c/plugin\u003e\n```\nmybaitis generator 的config中 配置\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003c!DOCTYPE generatorConfiguration\n        PUBLIC \"-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN\"\n        \"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd\"\u003e\n\n\u003cgeneratorConfiguration\u003e\n    \u003ccontext id=\"example\"\n             targetRuntime=\"MyBatis3Simple\"\n             defaultModelType=\"flat\"\u003e\n\n         \u003ccommentGenerator type=\"com.edison.CommentGenerator\"\u003e\n                    \u003cproperty name=\"author\" value=\"tsn\"/\u003e\n                    \u003cproperty name=\"allArgsConstructor\" value=\"false\"/\u003e\n                    \u003cproperty name=\"noArgsConstructor\" value=\"false\"/\u003e\n                    \u003cproperty name=\"toString\" value=\"false\"/\u003e\n                    \u003cproperty name=\"builder.toBuilder\" value=\"true\"/\u003e\n                    \u003cproperty name=\"builder\" value=\"true\"/\u003e\n         \u003c/commentGenerator\u003e\n    \u003c/context\u003e\n\u003c/generatorConfiguration\u003e\n```\n\n如果使用github的仓库 可以参照[这里](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-apache-maven-for-use-with-github-packages)配置，\n项目中的引用地址使用任意一个[package](https://github.com/supergaga/generator/packages) 都行\n\n## Authors\n\nMaintainer:\n* [supergaga](https://github.com/supergaga)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupergaga%2Fgenerator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsupergaga%2Fgenerator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupergaga%2Fgenerator/lists"}