MybatisPlus根据模板生成器代码
导读
网上的代码生成器,都不是自己想要的,今天下午研究了下,可以使用mybatisplus自定义模板,根据模板生成相应的代码,可以根据需求,改造相应模板即可。代码已上传github/百度云。
项目结构

pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>con.cyb</groupId>
<artifactId>ybchen_mybatis_builder</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>ybchen_mybatis_builder</name>
<description>mybatis代码生成器</description> <properties>
<java.version>1.8</java.version>
</properties> <dependencies>
<!-- spring boot -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<!-- web依赖,包含servlet,内置tomcat等 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- mysql -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- mybatis-plus依赖, 可以代替mybatis -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.1.1</version>
</dependency>
<!-- MyBatis-Plus 从 3.0.3 之后移除了代码生成器与模板引擎的默认依赖,需要手动添加相关依赖-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId>
<version>3.1.1</version>
</dependency>
<!-- Freemarker模板引擎 -->
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
</dependency>
</dependencies> <build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build> </project>
controller.java.ftl
package ${package.Controller};
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import ${package.Service}.${table.serviceName};
@RestController
@RequestMapping("/${table.entityPath}")
public class ${table.controllerName} {
    @Autowired
    private ${table.serviceName} ${table.entityPath}Service;
}
entity.java.ftl
package ${package.Entity};
import java.io.Serializable;
import java.util.Date;
<#list table.importPackages as pkg>
<#if pkg == "java.util.Date">
import ${pkg};
</#if>
</#list>
/**
 * ${table.name} : ${table.comment!}
 */
public class ${entity}  implements Serializable {
    private static final long serialVersionUID = 1L;
<#-- ----------  属性私有化  ---------->
<#list table.fields as field>
    <#if field.keyFlag>
        <#assign keyPropertyName="${field.propertyName}"/>
    </#if>
    <#if field.keyFlag>
    <#-- 主键 -->
    /**
     * 主键 : ${field.name},  ${field.comment!}
     */
    <#-- 普通字段 -->
    <#elseif !field.keyFlag>
    /**
     * ${field.name},  ${field.comment!}
     */
    </#if>
<#-- 乐观锁注解 -->
    <#if (versionFieldName!"") == field.name>
    @Version
    </#if>
<#-- 逻辑删除注解 -->
    <#if (logicDeleteFieldName!"") == field.name>
    @TableLogic
    </#if>
    <#if field.propertyType == "LocalDateTime">
        private Date ${field.propertyName};
    </#if>
    <#if field.propertyType != "LocalDateTime">
        private ${field.propertyType} ${field.propertyName};
    </#if>
</#list>
<#------------  构造函数   ----------- -->
    public ${entity}(<#list table.fields as field><#if field.propertyType == "LocalDateTime">Date ${field.propertyName}</#if><#if field.propertyType != "LocalDateTime">${field.propertyType} ${field.propertyName}</#if><#sep>,</#list>){
        <#list table.fields as field>
            this.${field.propertyName} = ${field.propertyName};
        </#list>
    }
    public ${entity}(){
    }
<#------------  getter.setter封装  ---------->
<#if !entityLombokModel>
    <#list table.fields as field>
        <#if field.propertyType == "boolean">
            <#assign getprefix="is"/>
        <#else>
            <#assign getprefix="get"/>
        </#if>
    public <#if field.propertyType == "LocalDateTime">Date</#if><#if field.propertyType != "LocalDateTime">${field.propertyType}</#if> ${getprefix}${field.capitalName}() {
        return ${field.propertyName};
    }
        <#if entityBuilderModel>
    public ${entity} set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
        <#else>
    public void set${field.capitalName}(<#if field.propertyType == "LocalDateTime">Date</#if><#if field.propertyType != "LocalDateTime">${field.propertyType}</#if> ${field.propertyName}) {
        </#if>
        this.${field.propertyName} = ${field.propertyName};
        <#if entityBuilderModel>
        return this;
        </#if>
    }
    </#list>
</#if>
<#-------------  重写toString()  ----------------->
<#if !entityLombokModel>
    @Override
    public String toString() {
        return "${entity}{" +
    <#list table.fields as field>
        <#if field_index==0>
        "${field.propertyName}=" + ${field.propertyName} +
        <#else>
        ", ${field.propertyName}=" + ${field.propertyName} +
        </#if>
    </#list>
        "}";
    }
</#if>
}
mapper.xml.ftl
package ${package.Mapper};
import ${package.Entity}.${entity};
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface ${table.mapperName}{
     /**
      *  查询表${table.name}所有信息
      */
     List<${entity}> findAll${entity}();
    <#list table.fields as field>
    <#if field.keyFlag>
     /**
      *  根据主键${field.propertyName}查询表${table.name}信息
      *  @param ${field.propertyName}
      */
     ${entity} find${entity}By${field.propertyName}(@Param("${field.propertyName}") ${field.propertyType} ${field.propertyName});
    </#if>
    </#list>
    /**
    *  根据条件查询表${table.name}信息
    *  @param ${table.entityPath}
    */
    List<${entity}> find${entity}ByCondition(${entity} ${table.entityPath});
    <#list table.fields as field>
    <#if field.keyFlag>
     /**
      *  根据主键${field.propertyName}查询表${table.name}信息
      *  @param ${field.propertyName}
      */
     Integer delete${entity}By${field.propertyName}(@Param("${field.propertyName}") ${field.propertyType} ${field.propertyName});
    </#if>
    </#list>
    <#list table.fields as field>
    <#if field.keyFlag>
     /**
      *  根据主键${field.propertyName}更新表${table.name}信息
      *  @param ${table.entityPath}
      */
     Integer update${entity}By${field.propertyName}(${entity} ${table.entityPath});
    </#if>
    </#list>
    <#list table.fields as field>
    <#if field.keyFlag>
     /**
      *  新增表${table.name}信息
      *  @param ${table.entityPath}
      */
     Integer add${entity}(${entity} ${table.entityPath});
    </#if>
    </#list>
}
mapper.xml.ftl
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="${package.Mapper}.${table.mapperName}"> <!-- 通用设置 -->
<#if baseColumnList>
<!-- 通用查询列 -->
<sql id="Base_Column_List">
<#list table.commonFields as field>
${field.name},
</#list>
${table.fieldNames}
</sql> <!-- 通用条件列 -->
<sql id="${entity}ByCondition">
<#list table.commonFields as field><#--生成公共字段-->
<if test="${field.propertyName}!=null and ${field.propertyName}!=''">
AND ${field.name} = ${r"#{"}${field.propertyName}${r"}"}
</if>
</#list>
<#list table.fields as field>
<#if !field.keyFlag><#--生成普通字段 -->
<if test="${field.propertyName}!=null and ${field.propertyName}!=''">
AND ${field.name} = ${r"#{"}${field.propertyName}${r"}"}
</if>
</#if>
</#list>
</sql> <!-- 通用设置列 -->
<sql id="${entity}SetColumns">
<#list table.commonFields as field><#--生成公共字段-->
<if test="${field.propertyName}!=null and ${field.propertyName}!=''">
${field.name} = ${r"#{"}${field.propertyName}${r"}"},
</if>
</#list>
<#list table.fields as field>
<#if !field.keyFlag><#--生成普通字段 -->
<if test="${field.propertyName}!=null and ${field.propertyName}!=''">
${field.name} = ${r"#{"}${field.propertyName}${r"}"},
</if>
</#if>
</#list>
</sql>
</#if> <#if baseResultMap>
<!-- 通用查询映射结果 -->
<resultMap id="${entity}Map" type="${package.Entity}.${entity}">
<#list table.fields as field>
<#if field.keyFlag><#--生成主键排在第一位-->
<id column="${field.name}" property="${field.propertyName}"/>
</#if>
</#list>
<#list table.commonFields as field><#--生成公共字段 -->
<result column="${field.name}" property="${field.propertyName}"/>
</#list>
<#list table.fields as field>
<#if !field.keyFlag><#--生成普通字段 -->
<result column="${field.name}" property="${field.propertyName}"/>
</#if>
</#list>
</resultMap>
</#if> <!-- 查询表${table.name}所有信息 -->
<select id="findAll${entity}" resultMap="${entity}Map">
SELECT
<include refid="Base_Column_List"/>
FROM ${table.name}
</select> <#list table.fields as field>
<#if field.keyFlag>
<!-- 根据主键${field.propertyName}查询表${table.name}信息 -->
<select id="find${entity}By${field.propertyName}" resultMap="${entity}Map">
SELECT
<include refid="Base_Column_List"/>
FROM ${table.name}
WHERE ${field.name}=${r"#{"}${field.propertyName}${r"}"}
</select>
</#if>
</#list> <!-- 根据条件查询表${table.name}信息 -->
<select id="find${entity}ByCondition" resultMap="${entity}Map">
SELECT
<include refid="Base_Column_List"/>
FROM ${table.name}
WHERE 1=1
<include refid="${entity}ByCondition" />
</select> <#list table.fields as field>
<#if field.keyFlag>
<!-- 根据主键${field.propertyName}删除表${table.name}信息 -->
<delete id="delete${entity}By${field.propertyName}">
DELETE FROM
${table.name}
WHERE ${field.name}=${r"#{"}${field.propertyName}${r"}"}
</delete>
</#if>
</#list> <#list table.fields as field>
<#if field.keyFlag>
<!-- 根据主键${field.propertyName}更新表${table.name}信息 -->
<update id="update${entity}By${field.propertyName}" parameterType="${package.Entity}.${entity}">
UPDATE ${table.name}
<set>
<include refid="${entity}SetColumns"/>
</set>
WHERE
<#list table.fields as field><#if field.keyFlag>${field.name}=${r"#{"}${field.propertyName}${r"}"}</#if></#list>
</update>
</#if>
</#list> <#list table.fields as field>
<#if field.keyFlag>
<!-- 新增表${table.name}信息 -->
<insert id="add${entity}">
INSERT INTO ${table.name} (
<#list table.fields as field>
<#if field_index gt 0>,</#if>${field.name}
</#list>
) VALUES (
<#list table.fields as field>
<#if field_index gt 0>,</#if>${r"#{"}${field.propertyName}${r"}"}
</#list>
)
</insert>
</#if>
</#list>
</mapper>
service.java.ftl
package ${package.Service};
import ${package.Entity}.${entity};
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ${table.serviceName}{
    /**
    *  查询表${table.name}所有信息
    */
    List<${entity}> findAll${entity}();
<#list table.fields as field>
<#if field.keyFlag>
    /**
    *  根据主键${field.propertyName}查询表${table.name}信息
    *  @param ${field.propertyName}
    */
    ${entity} find${entity}By${field.propertyName}(@Param("${field.propertyName}") ${field.propertyType} ${field.propertyName});
</#if>
</#list>
    /**
    *  根据条件查询表${table.name}信息
    *  @param ${table.entityPath}
    */
    List<${entity}> find${entity}ByCondition(${entity} ${table.entityPath});
<#list table.fields as field>
<#if field.keyFlag>
    /**
    *  根据主键${field.propertyName}查询表${table.name}信息
    *  @param ${field.propertyName}
    */
    Integer delete${entity}By${field.propertyName}(@Param("${field.propertyName}") ${field.propertyType} ${field.propertyName});
</#if>
</#list>
<#list table.fields as field>
<#if field.keyFlag>
    /**
    *  根据主键${field.propertyName}更新表${table.name}信息
    *  @param ${table.entityPath}
    */
    Integer update${entity}By${field.propertyName}(${entity} ${table.entityPath});
</#if>
</#list>
<#list table.fields as field>
<#if field.keyFlag>
    /**
    *  新增表${table.name}信息
    *  @param ${table.entityPath}
    */
    Integer add${entity}(${entity} ${table.entityPath});
</#if>
</#list>
}
serviceImpl.java.ftl
package ${package.ServiceImpl};
import ${package.Entity}.${entity};
import ${package.Mapper}.${table.mapperName};
import ${package.Service}.${table.serviceName};
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Service
public class ${table.serviceImplName} implements ${table.serviceName} {
    @Autowired
    private ${table.mapperName} ${table.entityPath}Mapper;
    /**
    *  查询表${table.name}所有信息
    */
    @Override
    public List<${entity}> findAll${entity}() { return ${table.entityPath}Mapper.findAll${entity}();}
<#list table.fields as field>
<#if field.keyFlag>
    /**
    *  根据主键${field.propertyName}查询表${table.name}信息
    *  @param ${field.propertyName}
    */
    @Override
    public ${entity} find${entity}By${field.propertyName}(@Param("${field.propertyName}") ${field.propertyType} ${field.propertyName}) { return ${table.entityPath}Mapper.find${entity}By${field.propertyName}(${field.propertyName});}
</#if>
</#list>
    /**
    *  根据条件查询表${table.name}信息
    *  @param ${table.entityPath}
    */
    @Override
    public List<${entity}> find${entity}ByCondition(${entity} ${table.entityPath}) { return ${table.entityPath}Mapper.find${entity}ByCondition(${table.entityPath});}
<#list table.fields as field>
<#if field.keyFlag>
    /**
    *  根据主键${field.propertyName}查询表${table.name}信息
    *  @param ${field.propertyName}
    */
    @Override
    public Integer delete${entity}By${field.propertyName}(@Param("${field.propertyName}") ${field.propertyType} ${field.propertyName}) { return ${table.entityPath}Mapper.delete${entity}By${field.propertyName}(${field.propertyName});}
</#if>
</#list>
<#list table.fields as field>
<#if field.keyFlag>
    /**
    *  根据主键${field.propertyName}更新表${table.name}信息
    *  @param ${table.entityPath}
    */
    @Override
    public Integer update${entity}By${field.propertyName}(${entity} ${table.entityPath}) { return ${table.entityPath}Mapper.update${entity}By${field.propertyName}(${table.entityPath});}
</#if>
</#list>
<#list table.fields as field>
<#if field.keyFlag>
    /**
    *  新增表${table.name}信息
    *  @param ${table.entityPath}
    */
    @Override
    public Integer add${entity}(${entity} ${table.entityPath}) { return ${table.entityPath}Mapper.add${entity}(${table.entityPath});}
</#if>
</#list>
}
Generator.java
package con.cyb.build; import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.InjectionConfig;
import com.baomidou.mybatisplus.generator.config.*;
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine; import java.util.ArrayList;
import java.util.List; /**
* @ClassName:Generator
* @Description:代码自动生成器
* @Author:chenyb
* @Date:2020/9/20 8:10 下午
* @Versiion:1.0
*/
public class Generator { public static void main(String[] args) {
// 生成地址 : // System.getProperty("user.dir") == 得到当前项目的实际地址
String outputDir = System.getProperty("user.dir") + "/src/main/java";
// String outputDir = "C://Users/VULCAN/Desktop/new";
// 表名, 注意大小写
String[] tableNames = new String[]{"chapter"};
// 数据库地址
String url = "jdbc:mysql://localhost:3306/online_ybclass?useUnicode=true&characterEncoding=utf8";
// 用户名
String userName = "root";
// 密码
String password = "root";
// 父包路径
String parentPackage = "con.cyb";
// 需要去掉的表名前缀
String prefixTable = "Test_";
generate(outputDir, tableNames, url, userName, password, parentPackage, prefixTable);
} /**
* @param outputDir 生成地址
* @param tableNames 表名
* @param url 数据库地址
* @param userName 用户名
* @param password 密码
* @param parentPackage 父包路径
* @param prefixTable 需要去掉的表名前缀
*/
public static void generate(String outputDir, String[] tableNames, String url, String userName,
String password, String parentPackage, String prefixTable) {
// =============== 全局配置 ==================
GlobalConfig gc = new GlobalConfig();
gc.setOutputDir(outputDir)
.setActiveRecord(true) // 是否支持 AR, 实体类只需继承 Model 类即可进行强大的 CRUD 操作
.setAuthor("GrassPrince") // 设置作者名字
.setFileOverride(true) // 文件覆盖(全新文件)
.setIdType(IdType.AUTO) // 主键策略
.setBaseResultMap(true) // SQL 映射文件
.setBaseColumnList(true) // SQL 片段
.setServiceName("%sService") // service的名字
.setOpen(false); // ================= 数据源配置 ===============
DataSourceConfig dsc = new DataSourceConfig();
dsc.setDbType(DbType.MYSQL)
.setDriverName("com.mysql.cj.jdbc.Driver");
dsc.setUrl(url)
.setUsername(userName)
.setPassword(password); // ================= 包配置 ===================
PackageConfig pc = new PackageConfig();
pc.setParent(parentPackage) // 配置父包路径
// .setModuleName("base") // 配置业务包路径
.setMapper("mapper")
.setEntity("entity")
.setService("service")
//.setServiceImpl("service.impl"); // 会自动生成 impl,可以不设定
.setController("controller"); // ================== 自定义配置 =================
InjectionConfig cfg = new InjectionConfig() {
@Override
public void initMap() {
// to do nothing
}
};
List<FileOutConfig> focList = new ArrayList<>();
// 调整 xml 生成目录演示
focList.add(new FileOutConfig("/templates/mapper.xml.ftl") {
@Override
public String outputFile(TableInfo tableInfo) {
// 自定义输入文件名称
return System.getProperty("user.dir") + "/src/main/resources/mybatis/"
+ tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
}
});
cfg.setFileOutConfigList(focList); // =================== 策略配置 ==================
StrategyConfig strategy = new StrategyConfig();
strategy.setNaming(NamingStrategy.underline_to_camel) // 表名命名: underline_to_camel 底线变驼峰
.setColumnNaming(NamingStrategy.underline_to_camel) // 字段命名: underline_to_camel 底线变驼峰
.setInclude(tableNames) // 需要生成的 表名
.setCapitalMode(true) // 全局大写命名 ORACLE 注意
.setTablePrefix(prefixTable) // 去掉 表的前缀
// .setFieldPrefix(pc.getModuleName() + "_") // 去掉字段前缀
// .setSuperEntityClass("com.maoxs.pojo") // 继承类
// .setSuperControllerClass("com.maoxs.controller") // 继承类
// .setSuperEntityColumns("id") // 设置超级超级列
// .setEntityLombokModel(true) // 是否加入lombok
.setControllerMappingHyphenStyle(true); // 设置controller映射联字符 // ================== 自定义模板配置: 默认配置位置 mybatis-plus/src/main/resources/templates ======================
// 放置自己项目的 src/main/resources/templates 目录下, 默认名称一下可以不配置,也可以自定义模板名称
TemplateConfig tc = new TemplateConfig();
tc.setXml(null) // 设置生成xml的模板
.setEntity("/templates/entity.java") // 设置生成entity的模板
.setMapper("/templates/mapper.java") // 设置生成mapper的模板
.setController("/templates/controller.java") // 设置生成service的模板
.setService("/templates/service.java") // 设置生成serviceImpl的模板
.setServiceImpl("/templates/serviceImpl.java"); // 设置生成controller的模板 // ==================== 生成配置 ===================
AutoGenerator mpg = new AutoGenerator();
mpg.setCfg(cfg)
.setTemplate(tc)
.setGlobalConfig(gc)
.setDataSource(dsc)
.setPackageInfo(pc)
.setStrategy(strategy)
.setTemplateEngine(new FreemarkerTemplateEngine()); // 选择 freemarker引擎,注意 pom 依赖必须有!
mpg.execute();
} }
演示


下载
github
https://github.com/543210188/MybatisBuilder
百度云盘
链接: https://pan.baidu.com/s/1a83ronSBhRisQ-U8HkTq_g 密码: 7kar
MybatisPlus根据模板生成器代码的更多相关文章
- 生成器-代码举例:()和yield
		
怎么自定义一个生成器:两个方法: 1.小括号包裹表达式 2.函数中用yield返回 方法一:①小括号包裹表达式 G=(x*2 for x in range(5)) print(G)输出:<gen ...
 - 创建JDBC模板简化代码、JDBC应用的事务管理以及连接池的作用
		
一.创建JDBC模板简化代码 一个简单的查询.要做这么一大堆事情,并且还要处理异常,我们不防来梳理一下: 1.获取connection 2.获取statement 3.获取resultset 4 ...
 - 编程算法 - 求1+2+...+n(模板类) 代码(C++)
		
求1+2+...+n(模板类) 代码(C++) 本文地址: http://blog.csdn.net/caroline_wendy 题目: 求1+2+...+n, 要求不能使用乘除法\for\whil ...
 - C++模板类代码只能写在头文件?
		
这个问题,实际上我几年前就遇到了.最近写个模板类玩的时候,再次遇到. 当我非常仔细的将定义和实现分开,在头文件中保留了最少的依赖后,一切就绪.cpp单独编过.但是当使用的时候,就会报告所有的函 ...
 - heredoc(实现模板与代码的分离)
		
heredoc(实现模板与代码的分离) 一.总结 heredoc实现模板与代码的分离,实现的是在后台编程语言中批量输出html代码,在这个批量输出的html代码中又可以嵌套编程语言变量.所以很方便. ...
 - Confluence未授权模板注入/代码执行(CVE-2019-3396)
		
--- title: Confluence未授权模板注入/代码执行(CVE-2019-3396) tags: [poc,cve] num :g7y12 --- # 简介 --- Confluence是 ...
 - MyBatis-Plus 代码生成器模板
		
MyBatis-Plus 代码生成器模板 maven 依赖 <!--Mysql--> <dependency> <groupId>mysql</groupId ...
 - Ef+T4模板实现代码快速生成器
		
转载请注明地址:http://www.cnblogs.com/cainiaodage/p/4953601.html 效果如图,demo(点击demo可下载案例) 项目结构如图 T4BLL添加BLL.t ...
 - SpringBoot+MybatisPlus+MySql 自动生成代码 自动分页
		
一.配置 <!-- Mybatis plus --> <dependency> <groupId>com.baomidou</groupId> < ...
 
随机推荐
- linux驱动之定时器的介绍和内核时间的学习
			
本文章摘自下面的网友: http://blog.sina.com.cn/s/blog_6e5b342e0100m87d.html 一.内核中如何记录时间 任何程序都需要时间控制,其主要目的是: 测量时 ...
 - rabbit rpm地址
			
rabbitmq 官方源: https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/ erlang 清华源(包含erlang所有版本): https:/ ...
 - Discovering Reinforcement Learning Algorithms
			
郑重声明:原文参见标题,如有侵权,请联系作者,将会撤销发布! arXiv:2007.08794v1 [cs.LG] 17 Jul 2020 Abstract 强化学习(RL)算法根据经过多年研究手动发 ...
 - flink创建视图的几种方式
			
import org.apache.flink.api.common.typeinfo.BasicTypeInfo; import org.apache.flink.api.java.typeutil ...
 - 简述HBase的Bulk Load
			
为什么用Bulk load? 批量加载数据到HBase集群,有很多种方式,比如利用 HBase API 进行批量写入数据.使用Sqoop工具批量导数到HBase集群.使用MapReduce批量导入等等 ...
 - Linux下非root用户运行Tomcat
			
PS:Linux下使用非root用户运行tomcat的原因 由于项目需求,也由于root用户启动tomcat有一个严重的问题,那就是tomcat具有root权限. 这意味着你的任何一个页面脚本(htm ...
 - day40:python操作mysql:pymysql模块&SQL注入攻击
			
目录 part1:用python连接mysql 1.用python连接mysql的基本语法 2.用python 创建&删除表 3.用python操作事务处理 part2:sql注入攻击 1.s ...
 - IDEA的Debug详解
			
01_Debug简介和意义 什么是程序DeBug? Debug,是程序开发人员必会的一项调试程序的技能. 企业中程序开发和程序调试的比例为1:1.5,可以说如果你不会调试程序,你就没有办法从事编程工作 ...
 - 手摸手 Elastic Stack 使用教程 - 环境安装
			
前言 在日常的开发中,会涉及到对一些中间件以及基础组件的使用,日志汇总分析.APM 监控.接口的健康检查.站内搜索,以及对于服务器.nginx.iis 等等的监控,最近的几个需求点,都和 Elasti ...
 - 【学习中】Unity<中级篇> Schedule
			
章节 内容 签到 Unity3D 实战技术第二版视频教程(中级篇) 1.游戏引擎发展史 2.Unity发展史 3.3D图形学与必要组件 5月19日 4.核心类_GameObject类 5月19日 5. ...