# mybatis-generator-lombok-plugin
**Repository Path**: charlescheung/mybatis-generator-lombok-plugin
## Basic Information
- **Project Name**: mybatis-generator-lombok-plugin
- **Description**: No description available
- **Primary Language**: Java
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 2
- **Created**: 2021-09-05
- **Last Updated**: 2021-09-05
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# MyBatis Generator Lombok plugin
A plugin for [MyBatis Generator](http://mybatis.github.io/generator/)
to use [Lombok](http://projectlombok.org/) annotations
instead of getters and setters. Helps to reduce the amount of
generated boilerplate code.
Code __before__ applying the Lombok plugin:
package example.dto;
public class Contact {
private Long id;
private String firstName;
private String lastName;
private String phone;
private String email;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}
Code __after__ applying the Lombok plugin (much shorter):
package example.dto;
import lombok.Data;
@Data
public class Contact {
private Long id;
private String firstName;
private String lastName;
private String phone;
private String email;
}
## Using the plugin
First things first, clone this repository locally and run:
mvn clean install
Then, in your MyBatis Generator configuration, include the plugin:
If you run MyBatis Generator from Maven, you can add the plugin as a dependency
for mybatis-generator-maven-plugin:
org.mybatis.generator
mybatis-generator-maven-plugin
${mybatis.generator.version}
true
com.softwareloop
mybatis-generator-lombok-plugin
1.0-SNAPSHOT
## Author
[Paolo Predonzani](https://github.com/softwareloop)