# codegen-maven-plugin **Repository Path**: bao-tingyu/codegen-maven-plugin ## Basic Information - **Project Name**: codegen-maven-plugin - **Description**: 自定义Maven插件,生成MyBatis实体类、Mapper、XML。Java源代码使用javapoet生成,XML使用jdom2生成 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-06-25 - **Last Updated**: 2023-07-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Auto-generate db entity, mapper interface, mapper XML of MyBatis - Java source code: javapoet - mapper XML: jdom2 # Example ## entity ![](doc/image/entity.png) ## mapper ![](doc/image/mapper.jpg) ## xml ![](doc/image/xml.jpg) ![](doc/image/xml2.jpg) # Quick Start 1. configure build in pom.xml ```xml site.btyhub codegen-maven-plugin 1.0 com.mysql mysql-connector-j ${mysql.version} ${absolute path of your yaml/yml config file} false ``` 2. config file:see sample.yaml in resources dir. only supports yaml/yml for now. 3. run `mvn codegen:codegen` 4. Example use case ```java PeopleExample peopleExample = new PeopleExample(); Criteria criteria = peopleExample.createCriteria(); criteria.andCreateTimeGt("2023").andIdBetween(1,10).andNameIsNull(); Criteria or = peopleExample.or(); or.andIdBetween(100,1000); peopleExample.setDistinct(true).setLimit(1).setOffset(199); ```