maven(18)-mybatis generator插件

SAP PO开发-端到端配置 1.登录PO系统,选择system landscape,将外围系统的系统信息(Software Component以下简称SC)注册到PO系统中。2.点击products注册外围系统信息。3.选择New 新建 按钮:创建一个新的系统和版本。4.输入产品名称、供应商、版本号等信息。然后点击:Next。5.设置instance 名称,然后点击Next。6.最后设置软件组件的名称,然后点击Finish。 阅读详情


generator的作用

使用mybatis框架,在初始项目或修改数据库时,相应的要在JAVA项目中去写一些数据模型文件,DAO,映射XML等配置,而这个插件的作用就是自动生成这些文件,以节省大量时间


pom.xml

    <build>
        <plugins>
            <plugin>
                <groupId>org.mybatis.generator</groupId>
                <artifactId>mybatis-generator-maven-plugin</artifactId>
                <version>1.3.5</version>
                <configuration>
                  <!-- 在控制台打印执行日志 -->
                  <verbose>true</verbose> 
                  <!-- 重复生成时会覆盖之前的文件-->  
                  <overwrite>true</overwrite>
                  <configurationFile>src/main/resources/generatorConfig.xml</configurationFile>  
                </configuration>
            </plugin>
        </plugins>
    </build>

generatorConfig.xml

默认在src/main/resources目录配置这个文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration
  PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
  "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
	<!-- mysql的jar文件路径 -->
	<classPathEntry location="D:\xxx\xxx.jar" />
	<context id="Mysql" targetRuntime="MyBatis3">
		<commentGenerator>
			<property name="suppressAllComments" value="true" />
			<property name="suppressDate" value="true" />
		</commentGenerator>
		
		<!-- 数据库相关配置 -->
		<jdbcConnection driverClass="com.mysql.jdbc.Driver"	connectionURL="jdbc:mysql://localhost/test?useSSL=false" userId="root" password="123456"/>

		<!-- 配置pojo目录 -->
		<javaModelGenerator targetPackage="mybatis.pojo" targetProject="src/main/java">
			<property name="enableSubPackages" value="true" />
		</javaModelGenerator>
		
		<!-- 配置xml映射目录 -->
		<sqlMapGenerator targetPackage="mybatis.mapper" targetProject="src/main/java">
			<property name="enableSubPackages" value="true" />
		</sqlMapGenerator>
		
		<!-- 配置dao目录 -->
		<javaClientGenerator type="XMLMAPPER" targetPackage="mybatis.dao" targetProject="src/main/java">
			<property name="enableSubPackages" value="true" />
		</javaClientGenerator>
		
		<!-- tableName是数据库中的表名,domainObjectName是生成的JAVA模型名,后面的参数不用改,要生成更多的表就在下面继续加table标签 -->
		<table tableName="demo" domainObjectName="demo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>
	</context>
</generatorConfiguration>
有注释的地方需要改成自己的环境配置

执行
执行命令:mvn mybatis-generator:generate

以上三个文件都是自动生成的

pip install mysql出现error: subprocess - exited-with-error的解决方案 本文主要介绍了pip install mysql出现error: subprocess - exited-with-error的解决方案,希望能对使用mysql的同学们有所帮助。 文章目录 1. 问题描述 2. 解决方案 阅读详情

相关推荐

保姆级教程:用杰理701N可视化SDK搞定ANC降噪配置(从工具到代码全流程)

本文提供了一份详细的杰理701N可视化SDK配置ANC降噪功能的教程,涵盖从开发环境搭建到代码集成的全流程。通过图形化工具和代码示例,帮助开发者快速掌握ANC参数配置技巧,优化降噪效果,解决常见问题。

weixin_30616969的博客 459

17代码生成器插件MyBatis Generator

Mybatis Generator简称 MBG,是一个专门为 MyBatis和 ibatis框架使用者提供的代码生成器。也可以快速的根据数据表生成对应的pojo类、Mapper接口、Mapper文件,甚至生成QBC风格的查询对象。一般在项目中,根据MyBatis Generator的XML配置文件设置生成简单的CRUD,但是复杂的查询或者有关关联的操作还是需要我们写SQL完成。pom.xml引出 mybatis-generator 坐标。

本人主攻Java,希望自己能成为出色的程序员。 2744

【自然语言处理】【多模态】多模态综述:视觉语言预训练模型

多模态预训练模型综述、模型结构、损失函数、下游任务、CLIP

bqw的博客 7768

使用 Maven 运行 mybatis-generator

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_34391854的博客 477

【机械臂算法】基于最小惯性参数集的动力学辨识仿真实践

本文深入探讨了机械臂动力学参数辨识的核心挑战与解决方案,重点阐述了基于最小惯性参数集的理论与方法。通过分析PUMA560实例,详细介绍了利用QR分解法或符号推导法获取可辨识参数集,并系统讲解了从激励轨迹设计、仿真数据采集、线性系统求解到模型验证的完整实践流程,为高精度动力学建模与控制奠定了坚实基础。

weixin_29054399的博客 382

保姆级教程:用Code Blocks搞定中科蓝讯AB5768E蓝牙音响SDK开发环境(附资源包)

本文提供了一份详细的Code Blocks配置指南,帮助开发者快速搭建中科蓝讯AB5768E蓝牙音响SDK开发环境。从工具链安装、环境配置到工程导入和调试技巧,涵盖全流程避坑要点,特别适合K12开发板初学者。附资源包下载,助您高效完成蓝牙音响开发。

weixin_28692817的博客 453

SpringBoot系列-- SpringBoot之Mybatis Generator生成器使用(多种方式)

目录1. 项目环境2. 引入依赖3.生成基于.xml形式使用mybatis的各层文件3.1 用generatorConfig.xml配置插件生成3.1.1 编写generatorConfig.xml文件3.1.2 关于generatorConfig.xml配置文件的补充说明3.1.3 开始生成文件3.2 使用Idea插件生成3.2.1 better-mybatis-generator插件简介3.2.2 better-mybatis-generator使用3.2.3 功能更强大的MyBatisCodeHelp

Gang-bb的博客 1万+

使用GEOquery包下载原始数据

使用GEOquery包下载原始数据

m0_75172651的博客 1911

mybatis-generator 代码自动生成工具(maven方式)

mybatis-generator 代码自动生成工具(maven方式) 由于MyBatis属于一种半自动的ORM框架,所以主要的工作将是书写Mapping映射文件,但是由于手写映射文件很容易出错,mybatis-gennerator插件帮我们自动生成mybatis所需要的dao、bean、mapper xml文件。 这里主要通过eclipse工具,来讲解实现; 1、建表语句 CREATE...

Json_wangqiang的博客 1212

直线型一阶倒立摆1---从理论到实践的桥梁

本文深入探讨了直线型一阶倒立摆在控制理论中的核心地位,从非线性控制、鲁棒性到实时反馈等关键问题。通过实际案例和硬件搭建指南,帮助读者理解从理论到实践的过渡,特别适合控制工程初学者和研究人员。文章还提供了算法选型建议和硬件避坑手册,是掌握倒立摆控制的实用指南。

weixin_29047545的博客 329

汇川AM系列PLC玩转CNC:手把手教你用File模式读取G代码文件(附避坑指南)

本文详细介绍了如何使用汇川AM系列PLC的File模式读取G代码文件,涵盖从CAD设计到PLC配置的全流程。特别针对路径格式、文件类型等常见问题提供避坑指南,帮助工程师快速实现CNC加工的自动化控制。

weixin_33582311的博客 416

mybatis 使用指南(全)

maven引入generator插件 关于 mybatis 的generator 的代码自动生成,官网为我们提供了多种整合方式,具体使用那个整合方式,视我们具体情况决定,这里 我们采用 maven插件的形式,关于插件配置属性的参数,可以点进maven 连接中查看具体参数配置。说明参考官网说明。 <plugin> <groupId>org.mybatis.generator</groupId> <artifactId>mybat

c1523456的博客 2338

EtherCAT学习之路——概述

首发于知乎 最近在做基于EtherCAT的项目,看了一些网上的博客,感觉写的都比较松散。虽然,自己也是才开始学习,希望能把这段时间学到的东西总结一下。 1.EtherCAT简介 EtherCAT是由德国BECKHOFF自动化公司于2003年提出的实时工业以太网技术。它具有高速和高数据有效率的特点,支持多种设备连接拓扑结构。其从站节点使用专用的控制芯片,主站使用标准的以太网控制器。 Et...

chenweizhen1991的博客 1万+

在IDEA开发工具中使用MyBatis代码自动生成插件

刚开始使用IntelliJ IDEA 开发工具,尝试使用该工具在项目中通过MyBatis代码自动生成插件生成项目连接数据库所需要的实体类、接口、映射文件;具体实现步骤如下: (1) MySQL数据表: (2)IntelliJ IDEA 开发工具中新建Maven项目;并创建application.properties配置文件、将generatorConfig.xml复制到项目根目录下,并修...

伱糸淂忄 1886

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

使用Maven插件运行Mybatis Generator

mysql版本:8.0.18 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:.

云上碧霄 361

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

mybatis-generator-maven-plugin插件的一些坑

mybatis-generator-maven-plugin插件的一些坑 1、配置mybatis-generator-maven-plugin插件 在maven的pom.xml的<build></build>节点内添加 <!--要放在与pluginManagement同级别才能生效--> <...

老杨的博客 2万+

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

Java框架-MyBatis三剑客之MyBatis Generator(mybatis-generator MBG插件)详解

首先确保自动生成文件的配置信息 直接在 IDEA 中操作 gradle 的命令 生成成功 可多次执行,类会覆盖,但是设计 mapper 的 xml 文件会重复生成

JavaEdge全是干货的技术号 2880

使用 Maven 运行 Mybatis-Generator

使用 MyBatis 的时候,我们要花大量的时间在写mapper映射文件的sql。MyBatis Generator 是 MyBatis 的代码生成器,可以帮我们去生成 Model、Dao、Mapper 和映射的 sql,节省不少时间 这里介绍使用 maven 插件方式去使用 MyBatis Generator 1、首先先 pom.xml 添加 mybatis-generator 插件配置 &lt...

TurboSnail 4884

maven插件mybatis-generator生成代码

第一步,在pom中加入插件 1 <plugin> 2 <groupId>org.mybatis.generator</groupId> 3 <artifactId>mybatis-generator-maven-plugin</artifactId> 4 <version>...

weixin_30456039的博客 126

mybatis-generator插件使用 批量插入、更新

1、 &lt;dependency&gt; &lt;groupId&gt;org.mybatis.generator&lt;/groupId&gt; &lt;artifactId&gt;mybatis-generator-core&lt;/artifactId&gt; &lt;version&gt;1.3.2&lt;/version&gt; &lt;/depen

孟凡霄 1万+

maven命令详解_MyBatis Generator(mybatis-generator MBG插件)详解

生成器设计思路: 连接数据库 -> 获取表结构 -> 生成文件1 下载与安装官网文档入口最方便的 maven 插件使用方式贴至pom 文件2 新建配置文件填充配置信息(官网示例)项目实例 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE generatorConfiguration PUBLIC "-//...

weixin_39638526的博客 350

mybatis-generator插件的用法介绍

mybatis-generator是一款在使用mybatis框架时,根据我们的数据库表,自动生成对应model,dao和mapper的工具,很大程度上减少了业务开发人员的手动编码时间,接下来我们来了解它的用法。 文章目录在pom.xml中添加插件配置generatorConfig.xml文件使用命令执行插件 在pom.xml中添加插件 <plugins> <plugin>...

lxcoding 649

Mybatis引用Generator插件

Generator可以快速生成基本的增删改查代码,引入插件主要分三个步骤。 ①导入相关依赖。 <plugins> <plugin> <groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator...

myCsdn_Xm的博客 464

mybatis generator with java IDEA MAVEN

1: 加入maven 依赖 org.mybatis.generator mybatis-generator-core 1.3.2 2: plugins插件 org.mybatis.generator mybatis-generator-

solebeibei的专栏 371

eclipse下用maven插件+Mabatis-generator生成mybatis的文件

1. 配置Maven pom.xml 文件 在pom.xml增加以下插件: 1 <build> 2 </plugins> 3 ... 4 <plugin> 5 <groupId>org.mybatis.generator...

aici0819的博客 220
上一篇: spring boot(6)-JdbcTemplate访问数据库
下一篇: spring boot(7)-mybatis全注解化
free_java
博客等级 码龄10年 664粉丝 131原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址