自动生成代码工具 文件工具类

                                                    自动生成代码工具 文件工具类

import java.io.File;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.ijwt.element.Global;
import com.ijwt.element.Table;

/**
 * @author InJavaWeTrust
 */
public enum UtilFile {

	INSTANCE;
	
	private static Logger log = LoggerFactory.getLogger(UtilFile.class);

	/**
	 * 创建目录
	 * @param path 需要生成的目录
	 */
	public void createDir(String path) {
		if(StringUtils.isNotEmpty(path)) {
			File folder = new File(path);
			boolean tof = folder.mkdirs();
			if (tof) {
				log.info("---->目录[{}]创建成功!!!", folder.getName());
			} else {
				log.info("---->目录[{}]创建失败或已存在!!!", folder);
			}
		}
	}

	/**
	 * 初始化目录
	 * @param global
	 */
	public void initDirName(Global global) {
		// 1.po
		String poDir = global.getOsdir() + File.separatorChar + "po";
		createDir(poDir);
		// 2.xml
		String xmlDir = global.getOsdir() + File.separatorChar + "xml";
		createDir(xmlDir);
	}
	
	public void generateTableFile(Global global) {
		log.info("------------------生成表文件开始------------------");
		List<Table> tableList = UtilXML.INSTANCE.getTableList();
		for (Table table : tableList) {
			String tableName = table.getTableName();
			log.info("----> [{}] 表", tableName);
			//校验从xml配置文件中得到的表名是否存在于当前数据中
			if (!UtilDB.getAllTableName().contains(tableName)) {
				log.warn("=====>当前数据库不包含此 [{}] 表,请检查配置!!!", tableName);
				continue;
			}
			String javaClassName = UtilString.INSTANCE.capitalize(UtilString.INSTANCE.columnNameToJavaName(tableName));
			Map<Object, Object> map = UtilFreemarker.INSTANCE.getTableInfo(tableName);
			map.put("author", global.getAuthor());
			map.put("project", global.getProject());
			map.put("className", javaClassName);
			map.put("javapackage", global.getJavapackage());
			// 1.po
			String poName = global.getOsdir() + File.separatorChar + "po" + File.separatorChar + javaClassName + "PO.java";
			UtilFreemarker.INSTANCE.generateFile(poName, "javapo.ftl", map);
			// 2.xml
			String mapperName = global.getOsdir() + File.separatorChar + "xml" + File.separatorChar + javaClassName + ".xml";
			UtilFreemarker.INSTANCE.generateFile(mapperName, "mapper.ftl", map);
		}
	}
}

 

AI自动生成代码工具 Codex是由OpenAI开发的,基于GPT-3的语言模型,用于生成代码。通过使用其Transformers库,开发者可以尝试训练和使用不同类型的语言模型来生成代码。在使用这些工具时,开发者需要谨慎验证生成的代码,并理解其潜在风险。尽管这些工具可以提高开发效率,但在生产环境中仍然需要人工审查和测试,以确保生成的代码符合质量和安全标准。它通过学习开发者的编码习惯,提供上下文感知的建议,从而加速编码过程。它可以检测潜在的错误、漏洞和最佳实践问题。它可以通过简单的描述生成复杂的代码块,帮助开发者提高效率。 阅读详情

相关推荐

提升开发效率:Java代码自动生成工具指南

本文还有配套的精品资源,点击获取 简介:Java代码生成工具通过自动化生成基础的数据库操作代码,包括实体类、DAO类、Mapper接口和XML配置文件,大大缩短了开发时间。它支持通过输入数据库信息快速构建应用框架,使用ORM框架实现与数据库的交互,同时保持代码的整洁性和一致性。工具通常集成在IDE中,能够根据数据库结构变动自动更新代码,使得开发者能够专注于业务逻辑的实现。 ...

weixin_42561464的博客 2680

Java项目代码自动生成工具及最佳实践

在现代软件开发中,为了提高开发效率和代码质量,使用代码生成工具已经成为一种常见的实践。本文将介绍一些流行的Java项目代码生成工具,并提供一些建议和最佳实践,以确保生成的代码符合项目需求和规范。

迷迷糊糊,懵懵懂懂 1693

java开发代码工具类全

加密工具,获取ip,字节转化,参数拼接,获取时间格式,参数类型转化,request参数转化map对象

SpringBoot代码自动生成小工具

SpringBoot 通过工具自动生成数据库实体类,dao,service,controller

m0_60681411的博客 934

代码自动生成工具

mybatis-generator-1.35-master 代码自动生成工具 使用教程参考说明

java代码自动生成器

支持java类的自动生成,一键生成所有代码,方便修改,维护

自动生成JAVA代码的工具

在现代软件开发中,Java仍然占据着重要的位置。随着技术的发展,越来越多的工具被开发出来,以提高开发效率,减少重复劳动。本文将介绍五个流行且强大的工具:JHipster、MyBatis Generator、OpenAPI Generator、Spring Roo 和 Lombok。通过这些工具,开发者可以更高效地编写、管理和维护代码。

m0_60525421的博客 2615

java代码自动生成工具

这一款绿色版的自动生成工具(解压打开Java代码生成工具2.0.exe即可), 可以自动读取数据库表,勾选程序中需要操作的的表,自动生成一个struts1+spring+hibernate struts2+spring+hibernate spring+springmvc+hibernate框架,支持oracle、mysql、db2、sqlserver 操作简单遍历,大家可亲自体验。

自动生成Java代码,mybatis mapper文件工具

自动生成代码工具 通过freemarker模板生成MySQL数据库表对应的Javabean和mybatis mapper文件。 配置文件 模板文件 自定义异常 工具类 数据库工具类 文件工具类 模板工具类 字符串工具类 配置文件工具类 bean类 其他类...

4万+

MPU6050芯片 寄存器详解与配置指南(详解)

分频值越小,数据刷新越快(如分频值 = 0 时,刷新率 = 8kHz/1=8kHz)。功能:配置采样频率分频系数,控制 ADC 转换速度和数据刷新率。数据刷新率 = 陀螺仪输出时钟频率 /(1 + 分频值)

m0_74696257的博客 1424

机械设计师必看:如何用Autodesk Inventor高效完成钣金设计(附实战案例)

本文为机械设计师详细解析了如何利用Autodesk Inventor Professional高效完成钣金设计。文章通过一个钣金防护罩的实战案例,系统介绍了从核心设计逻辑、建模流程、参数化技巧到工程图输出的完整工作流,旨在帮助设计师掌握智能化的设计方法,显著提升从概念到制造的设计效率与准确性。

honey的博客 1184

自动生成代码工具 模板文件

自动生成代码工具 模板文件 package ${javapackage}.po; /** * <p>${title}</p> * 类名:${className}PO<br> * 创建人:${author}<br> * 创建时间:${.now?string(...

4万+

【小程序】支付宝直付通解决方案

支付宝直付通是支付宝为小程序提供的一种支付解决方案,可以实现小程序中直接使用支付宝进行支付。以上是一个简单的支付宝直付通解决方案及相关代码示例。具体的使用还需要根据自己的业务需求进行定制化开发和调整。

qq_31532979的贺公子之数据科学与艺术博客,致力于科技向善,拥抱开源,要用技术的影响力来领导团队,而不是威权和职位! 1281

CRC自动生成代码工具:项目推荐文章

CRC自动生成代码工具:项目推荐文章 【下载地址】CRC自动生成代码工具 CRC自动生成代码工具专为电子设计工程师打造,能够高效生成VHDL或Verilog代码,大幅提升开发效率。工具支持多种CRC算法,满足不同应用场景需求。用户只需输入相关参数,即可快速生成所需的代码,并轻松集成到项目中。内置详细说明文档,帮助用户快速...

gitblog_06760的博客 972

告别手动连接!一键搞定Mumu模拟器与Android Studio的ADB配置

本文详细介绍了如何通过编写自动化脚本,一键完成Mumu模拟器与Android Studio的ADB连接配置。告别繁琐的手动命令输入,该脚本能智能检查环境、判断连接状态并自动处理端口转发,显著提升Android开发者的调试与测试效率。

yog99的博客 498

利用arpspoof + sslStrip尝试进行arp欺骗

利用arpspoof + sslStrip尝试进行arp欺骗

qq_63575829的博客 359

CRC自动生成代码工具

CRC自动生成代码工具 【下载地址】CRC自动生成代码工具 CRC自动生成代码工具专为电子设计工程师打造,能够高效生成VHDL或Verilog代码,大幅提升开发效率。工具支持多种CRC算法,满足不同应用场景需求。用户只需输入相关参数,即可快速生成所需的代码,并轻松集成到项目中。内置详细说明文档,帮助用户快速上手,节省学习...

gitblog_06767的博客 662

从ISCXTor2016到CICIDS2017:手把手教你下载和使用UNB的网络安全数据集

本文详细介绍了UNB大学发布的ISCXTor2016和CICIDS2017等网络安全数据集的下载与使用方法,特别适合加密流量识别和网络行为分析研究。文章提供了多种高效获取路径、文件结构解析及实战分析示例,帮助研究者快速上手这些真实场景捕获的精细标注数据集。

weixin_42524945的博客 640

自动生成代码工具 模板工具类

自动生成代码工具 模板工具类 import java.io.BufferedWriter; import java.io.FileOutputStream; import java.io.OutputStreamWriter; import java.util.ArrayList; i...

4万+

【人工智能】从零开始玩转龙虾(Openclaw):本地与云端(火山Arkcloud)部署全指南

龙虾(Openclaw)是一款海外智能体操作系统(agent operating system),可通过飞书机器人实现自动化办公、信息抓取、任务协作等功能。它支持本地部署和云端部署两种方式,适配MacOS和Windows系统(,建议优先使用MacOS)。sudo。

奶爸的编程之路,也就一周冷个三天 947

【入门AUTOSAR网络管理测试】CANoe测试T_WakeUp时间

随着智能电动汽车行业的快速发展,目前AUTOSAR网络管理也得到了广泛应用,AUTOSAR网络管理测试也是汽车网络测试中非常重要的环节,NM问题导致的汽车ECU不能唤醒、电瓶亏电等问题,对于新入门AUTOSAR网络管理测试的同学不清楚如何开展测试,那么本章节就主要给大家介绍网络管理中T_WakeUp时间如何测试。【入门AUTOSAR网络管理测试】AUTOSAR网络管理规范需求解读。

测试领域技术分享 2138

自动生成代码工具 配置文件

自动生成代码工具 配置文件 <?xml version="1.0" encoding="UTF-8" ?> <config> <global> <osdir value="E:\workspace\ijwt-ftl\src\main\resource...

4万+

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

自动生成代码工具 配置文件工具类

自动生成代码工具 配置文件工具类 import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import org.dom4j.Do...

4万+

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

深度学习工具包 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")

自动生成代码工具 数据库工具类

自动生成代码工具 数据库工具类 import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.DriverManager; import java.sql.PreparedStatement; i...

4万+

IDEA的使用指南

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

自动生成代码工具 其他类

自动生成代码工具 其他类 /** * @author InJavaWeTrust */ @FunctionalInterface public interface XMLElement<T, E> { /** * 获取配置文件中的元素 * @param t * @return ...

4万+
上一篇: 自动生成代码工具 数据库工具类
下一篇: 自动生成代码工具 模板工具类
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值