An open API service indexing awesome lists of open source software.

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

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