Git Product home page Git Product logo

asteria-generate-core's Introduction

asteria-generate-core

plugins

name description
AsteriaOptionalPlugin java 8 Optional
AsteriaLombokPlugin lombok(client)
AsteriaEntityPlugin entity(DTO lombok)
AsteriaServicePlugin serviceInterface
AsteriaServiceImplPlugin serviceImpl

context(properties)

prop description
targetProject
basePackage base package

AsteriaLombokPlugin(properties)

prop description
lombokBuilder enabled lombok builder , default value(false)

AsteriaEntityPlugin(properties)

prop description
entityPackage entity package , default value(entity)
entitySuffix entity suffix , default value(DTO)

AsteriaServicePlugin(properties)

| prop | description | | servicePackage | service package , default value(service) | | servicePrefix | service prefix | | serviceSuffix | service suffix , default value(Service) |

AsteriaServiceImplPlugin(properties)

| prop | description | | serviceImplPackage | serviceImpl package , default value(service.impl) | | serviceImplPrefix | serviceImpl prefix | | serviceImplSuffix | serviceImpl suffix , default value(Impl) |

use

MyBatis3DynamicSql

<!DOCTYPE generatorConfiguration PUBLIC
    "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
    "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
    <context id="sql" targetRuntime="MyBatis3DynamicSql">

        <property name="javaFileEncoding" value="UTF-8"/>
        <property name="targetProject" value="src/test/java"/>
        <property name="basePackage" value="io.github.homeant"/>
        <property name="beanMapperType" value="orika"/>


        <plugin type="io.github.asteria.generator.mybatis.plugin.AsteriaOptionalPlugin">
            <property name="lombokBuilder" value="true"/>
        </plugin>
        <plugin type="io.github.asteria.generator.mybatis.plugin.AsteriaLombokPlugin"/>
        <plugin type="io.github.asteria.generator.mybatis.plugin.AsteriaEntityPlugin">
            <property name="entityPackage" value="entity"/>
            <property name="entitySuffix" value="DTO"/>
        </plugin>
        <plugin type="io.github.asteria.generator.mybatis.plugin.AsteriaServicePlugin">
            <property name="servicePackage" value="service"/>
            <property name="servicePrefix" value=""/>
            <property name="serviceSuffix" value="Service"/>
        </plugin>
        <plugin type="io.github.asteria.generator.mybatis.plugin.AsteriaServiceImplPlugin">
            <property name="serviceImplPackage" value="service.impl"/>
            <property name="serviceImplPrefix" value=""/>
            <property name="serviceImplSuffix" value="ServiceImpl"/>
        </plugin>


        <commentGenerator type="io.github.asteria.generator.mybatis.plugin.comment.AsteriaCommentGenerator">
            <property name="suppressDate" value="true"/>
            <property name="addRemarkComments" value="true"/>
        </commentGenerator>

        <jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
                        connectionURL="jdbc:mysql://{you db url}/ops_admin?user={user}&amp;password={password}&amp;useUnicode=true" />


        <javaModelGenerator targetPackage="io.github.homeant.domain" targetProject="src/test/java"/>

        <javaClientGenerator targetPackage="io.github.homeant.mapper" targetProject="src/test/java" />


        <table tableName="t_dict_type">
            <generatedKey column="id" sqlStatement="JDBC"/>
            <domainObjectRenamingRule searchString="^T" replaceString=""/>
            <columnOverride column="is_valid" javaType="java.lang.Integer"/>
            <columnOverride column="status" javaType="java.lang.Integer"/>
        </table>
    </context>

</generatorConfiguration>

MyBatis3

<!DOCTYPE generatorConfiguration PUBLIC
    "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
    "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
   <context id="MyBatis3" targetRuntime="MyBatis3">

       <property name="javaFileEncoding" value="UTF-8"/>
       <property name="targetProject" value="src/test/java"/>
       <property name="basePackage" value="io.github.homeant"/>
       <property name="beanMapperType" value="orika"/>


       <plugin type="io.github.asteria.generator.mybatis.plugin.AsteriaOptionalPlugin">
           <property name="lombokBuilder" value="true"/>
       </plugin>
       <plugin type="io.github.asteria.generator.mybatis.plugin.AsteriaLombokPlugin"/>
       <plugin type="io.github.asteria.generator.mybatis.plugin.AsteriaEntityPlugin">
           <property name="entityPackage" value="entity"/>
           <property name="entitySuffix" value="DTO"/>
       </plugin>
       <plugin type="io.github.asteria.generator.mybatis.plugin.AsteriaServicePlugin">
           <property name="servicePackage" value="service"/>
           <property name="servicePrefix" value=""/>
           <property name="serviceSuffix" value="Service"/>
       </plugin>
       <plugin type="io.github.asteria.generator.mybatis.plugin.AsteriaServiceImplPlugin">
           <property name="serviceImplPackage" value="service.impl"/>
           <property name="serviceImplPrefix" value=""/>
           <property name="serviceImplSuffix" value="ServiceImpl"/>
       </plugin>

        <commentGenerator type="io.github.asteria.generator.mybatis.plugin.comment.AsteriaCommentGenerator">
            <property name="suppressDate" value="true"/>
            <property name="addRemarkComments" value="true"/>
        </commentGenerator>

        <jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
                        connectionURL="jdbc:mysql://{you db url}/ops_admin?user={user}&amp;password={password}&amp;useUnicode=true" />

        <javaModelGenerator targetPackage="io.github.homeant.domain" targetProject="src/test/java"/>

        <sqlMapGenerator targetPackage="mapper" targetProject="src/test/resources"/>

        <javaClientGenerator targetPackage="io.github.homeant.mapper" targetProject="src/test/java" type="MAPPER"/>

        <table tableName="t_dict_type">
            <generatedKey column="id" sqlStatement="JDBC"/>
            <domainObjectRenamingRule searchString="^T" replaceString=""/>
            <columnOverride column="is_valid" javaType="java.lang.Integer"/>
            <columnOverride column="status" javaType="java.lang.Integer"/>
        </table>
    </context>
</generatorConfiguration>

asteria-generate-core's People

Contributors

homeant avatar

Stargazers

 avatar

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.