Coder Social home page Coder Social logo

mbg_lombok_plugin's Introduction

mbg_lombok_plugin

add lombok to mybatis generator

Add lombok support to mbg by implements PluginAdapter

Quick Start

  • add the jar(get from assets folder or build from git) to your classpath
  • add depency in mybatis-generator-maven-plugin as follows:
<plugin>
	<groupId>org.mybatis.generator</groupId>
	<artifactId>mybatis-generator-maven-plugin</artifactId>
	<version>1.3.5</version>
	<configuration>
		<configurationFile>src/main/resources/mbg/genarateMybatis.xml</configurationFile>
		<verbose>true</verbose>
		<overwrite>false</overwrite>
	</configuration>
	<dependencies>
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>5.1.38</version>
	  </dependency>
		<dependency>
			<groupId>mbg.plugin</groupId>
			<artifactId>mbg.lombok</artifactId>
			<version>1.0-SNAPSHOT</version>
			<scope>system</scope>
			<systemPath>your mbg.lombok.jar absolute path</systemPath>
		</dependency>
	</dependencies>
</plugin>
  • add element to mbg-config.xml type="org.mybatis.generator.plugins.lombok.LombokPlugin"
  1. if add plugin with empty body ,the plugin default add Builder,Data,NoArgsConstructor,AllArgsConstructor to java model
  2. you can add property name: customLombok ,value: lombok annotation spilit by "," ;to custom the lombok annotation you need ,eg:<property name="customLombok" value="@Builder,@Data"/

pay attention to the element order ,the element should before other element except propeties

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.