https://github.com/mivui/mybatis-extension-plugin
https://github.com/mivui/mybatis-extension-plugin
mybatis mybatis-dynamic-sql mybatis-generator
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/mivui/mybatis-extension-plugin
- Owner: mivui
- License: apache-2.0
- Created: 2020-05-18T01:14:58.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2022-11-25T01:44:21.000Z (over 3 years ago)
- Last Synced: 2025-03-29T13:22:41.945Z (about 1 year ago)
- Topics: mybatis, mybatis-dynamic-sql, mybatis-generator
- Language: Java
- Size: 60.5 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mybatis-extension-plugin
English | [中文](./ZH_CN.md)
* For ease of use, align with the main version number of mybatis-generator
* Introduction
* Support Mybatis3 and mybatis-dynamic-sql
* Note: You need to learn the use of mybatis-generator-maven-plugin first http://mybatis.org/generator/running/runningWithMaven.html
* Note: You need to learn the configuration of the generated file first http://mybatis.org/generator/configreference/xmlconfig.html
* Provide Entity, Dao extension
* Provide Service, Controller generation
------
##### Add dependency (example)
```xml
io.github.mioxs
mybatis-extension-plugin
1.4.2
runtime
true
org.mybatis.generator
mybatis-generator-maven-plugin
1.4.1
Generate MyBatis Artifacts
deploy
generate
true
true
mysql
mysql-connector-java
8.0.31
io.github.mioxs
mybatis-extension-plugin
1.4.2
```
------
#### Plugin usage
> LombokPlugin (lombok generation)
| property | defaults | introduction |
|---------|--------|---------|
| data | false | include getter,setter,toString,equalsAndHashCode,requiredArgsConstructor |
| getter | false | getter |
| setter | false | getter |
| toString | false | toString |
| equalsAndHashCode | false | equalsAndHashCode |
| builder | false | builder |
| noArgsConstructor | false | noArgsConstructor |
| allArgsConstructor | false | allArgsConstructor |
| requiredArgsConstructor | false | requiredArgsConstructor |
##### Examples
* The \ element is a child element of the \ element. Any number of plugins can be specified in the context.
```xml
```
------
> DomainPlugin (Entity class extension)
| property | defaults | introduction |
|---------|--------|---------|
| serializable | false | Whether to implement Serializable |
| dateSerialize | false | Date serialization only supports JDK 8 date types |
| json | null | Date deserialization only supports JDK8 date types (options: fastJson, jackson) |
##### Examples
* The \ element is a child element of the \ element. Any number of plugins can be specified in the context.
```xml
```
------
> RepositoryPlugin (Data Access Object DAO Extension)
| property | defaults | introduction |
|---------|--------|---------|
| suppressAllComments | false | Whether to remove the generated comments |
| repository | null | Dao parent class, default is null |
##### Examples
* The \ element is a child element of the \ element. Any number of plugins can be specified in the context.
```xml
```
------
> ServicePlugin (Service generation)
| property | defaults | introduction |
|---------|--------|---------|
| targetProject | null | Generate path example: src/main/java |
| targetPackage | null | generate package path example: org.example.service |
| basicService | null | service interface parent class default is null |
| basicServiceImpl | null | serviceImpl parent class, default is null |
##### Examples
*The \ element is a child element of the \ element. Any number of plugins can be specified in the context.
```xml
```
------
> ControllerPlugin (Controller generation)
| property | defaults | introduction |
|---------|--------|---------|
| targetProject | null | Generate path example: src/main/java |
| targetPackage | null | Generate package path example: org.example.controller |
| rest | false | true for @RestController, false for @Controller |
| respond | null | The controller returns the result set. The default is null |
##### Examples
* The \ element is a child element of the \ element. Any number of plugins can be specified in the context.
```xml
```
##### Generate impressions (partial code)
```java
@Slf4j
@RestController
@RequestMapping("example")
public class ExampleController {
@Autowired
private ExampleService exampleService;
@GetMapping("findAll")
public Respond findAll() {
return null;
}
//...
}
```
------
> Generate
* Idea opens the right side maven->plugins->mybatis-generator-> mybatis-generator:generator Click to execute
* Or mvn mybatis-generator:generator