java代码一健生成 java代码生成uuid

java代码生成器怎么用zip包java代码一健生成,然后自动下载下来
1.预先定义好模板
2.界面输入相关参数
3.解析模板生成代码并下载
最后放出源代码java代码一健生成:
package com.et.controller.system.createcode;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.et.controller.base.BaseController;
import com.et.util.DelAllFile;
import com.et.util.FileDownload;
import com.et.util.FileZip;
import com.et.util.Freemarker;
import com.et.util.PageData;
import com.et.util.PathUtil;
/**
* 类名称java代码一健生成:FreemarkerController
* 创建人:Harries
* 创建时间:2015年1月12日
* @version
*/
@Controller
@RequestMapping(value=https://www.04ip.com/post/”/createCode”)
public class CreateCodeController extends BaseController {
/**
* 生成代码
*/
@RequestMapping(value=https://www.04ip.com/post/”/proCode”)
public void proCode(HttpServletResponse response) throws Exception{
PageData pd = new PageData();
pd = this.getPageData();
/* ============================================================================================= */
String packageName = pd.getString(“packageName”); //包名 ========1
String objectName = pd.getString(“objectName”); //类名 ========2
String tabletop = pd.getString(“tabletop”); //表前缀 ========3
tabletop = null == tabletop?””:tabletop.toUpperCase(); //表前缀转大写
String zindext = pd.getString(“zindex”); //属性总数
int zindex = 0;
if(null != zindext!””.equals(zindext)){
zindex = Integer.parseInt(zindext);
}
ListString[] fieldList = new ArrayListString[](); //属性集合 ========4
for(int i=0; i zindex; i){
fieldList.add(pd.getString(“field” i).split(“,fh,”)); //属性放到集合里面
}
MapString,Object root = new HashMapString,Object(); //创建数据模型
root.put(“fieldList”, fieldList);
root.put(“packageName”, packageName); //包名
root.put(“objectName”, objectName); //类名
root.put(“objectNameLower”, objectName.toLowerCase()); //类名(全小写)
root.put(“objectNameUpper”, objectName.toUpperCase()); //类名(全大写)
root.put(“tabletop”, tabletop); //表前缀
root.put(“nowDate”, new Date()); //当前日期
DelAllFile.delFolder(PathUtil.getClasspath() ”admin/ftl”); //生成代码前,先清空之前生成java代码一健生成的代码
/* ============================================================================================= */
String filePath = “admin/ftl/code/”; //存放路径
String ftlPath = “createCode”; //ftl路径
/*生成controller*/
Freemarker.printFile(“controllerTemplate.ftl”, root, “controller/” packageName ”/” objectName.toLowerCase() ”/” objectName ”Controller.java”, filePath, ftlPath);
/*生成service*/
Freemarker.printFile(“serviceTemplate.ftl”, root, “service/” packageName ”/” objectName.toLowerCase() ”/” objectName ”Service.java”, filePath, ftlPath);
/*生成mybatis xml*/
Freemarker.printFile(“mapperMysqlTemplate.ftl”, root, “mybatis_mysql/” packageName ”/” objectName ”Mapper.xml”, filePath, ftlPath);
Freemarker.printFile(“mapperOracleTemplate.ftl”, root, “mybatis_oracle/” packageName ”/” objectName ”Mapper.xml”, filePath, ftlPath);
/*生成SQL脚本*/
Freemarker.printFile(“mysql_SQL_Template.ftl”, root, “mysql数据库脚本/” tabletop objectName.toUpperCase() ”.sql”, filePath, ftlPath);
Freemarker.printFile(“oracle_SQL_Template.ftl”, root, “oracle数据库脚本/” tabletop objectName.toUpperCase() ”.sql”, filePath, ftlPath);
/*生成jsp页面*/
Freemarker.printFile(“jsp_list_Template.ftl”, root, “jsp/” packageName ”/” objectName.toLowerCase() ”/” objectName.toLowerCase() ”_list.jsp”, filePath, ftlPath);
Freemarker.printFile(“jsp_edit_Template.ftl”, root, “jsp/” packageName ”/” objectName.toLowerCase() ”/” objectName.toLowerCase() ”_edit.jsp”, filePath, ftlPath);
/*生成说明文档*/
Freemarker.printFile(“docTemplate.ftl”, root, “说明.doc”, filePath, ftlPath);
//this.print(“oracle_SQL_Template.ftl”, root); 控制台打印
/*生成的全部代码压缩成zip文件*/
FileZip.zip(PathUtil.getClasspath() ”admin/ftl/code”, PathUtil.getClasspath() ”admin/ftl/code.zip”);
/*下载代码*/
FileDownload.fileDownload(response, PathUtil.getClasspath() ”admin/ftl/code.zip”, “code.zip”);
}
}
怎样利用 eclipse mybatis generator 自动生成代码MyBatis中,可以使用Generator自动生成代码,包括DAO层、 MODEL层 、MAPPING SQL映射文件 。
第一步:下载MyBatis的Generator工具
htt p:/ /mybati s.gith ub.i o/generator/
第二步:配置自动生成代码所需的XML配置文件,例如(generator.xml)
将这个文件保存至你下载的mybatis-generator-core-1.3.2文件夹下
【java代码一健生成 java代码生成uuid】第三步:进入XML配置文件(generator.xml)所在的的目录并执行命令:
Dos代码
java -jar E:\mybatis-generator-core-1.3.2\lib\mybatis-generator-core-1.3.2.j ar -configfile generator.xml -overwrite
mybatis generator eclipse插件的安装
打开eclipse,点击HelpSoftware Update
选择 "Available Software" 标签,点击 "Add Site" 按钮
输入以下信息:
Location:htt p:/ /mybatis.googleco de.c om/svn/sub-projects/gen erator/trunk/eclipse/UpdateSite/
点击ok,自动进入"mybatis generator Feature"
点击“install”按钮进行安装 。。。。mybatis generator 插件安装完成
配置Mybatis Generator不要生成Example类
Mybatis Generator默认设置会生成一大堆罗哩罗嗦的Example类,主要是用各种不同的条件来操作数据库,大部分是用不到的,用到的时候手工修改mapper和接口文件就行了 。
/codetable
schema="general"
tableName="tb_table_name"
domainObjectName="EntityName"
enableCountByExample="false"
enableUpdateByExample="false"
enableDeleteByExample="false"
enableSelectByExample="false"
selectByExampleQueryId="false"
name="useActualColumnNames"
value="https://www.04ip.com/post/true"/
//codetable
这样生成的mapper和dao接口就清爽多了 。
JeeCGBoot低代码开发平台,强大的代码生成器前后端一起生成今日推荐:JeeCGBoot低代码开发平台
推荐理由:
1、前后端实现分离架构,通过API调用,实现架构解耦
2、项目集成SpringBoot、SpringCloud的Spring全家桶
3、在线实现开发,表单开发设计、报表配置、在线图表设计、在线设计流程、流程自动化、插件能力等
4、系统集成了工作流,实现扩展任务接口 。
5、解决java项目的70%的重复工作
6、最重要的是技术售后的完善,有完善的开发文档,常见问题 , 交流群
适用场景
1、内部办公系统OA
2、企业资源计划系统ERP
3、客户关系管理系统CRM
4、企业信息管理系统
5、电商SAAS系统
功能特色:
1、支持微服务SpringCloudAlibab全家桶
2、前后端高效代码生成器 , 单表,一对多模型,CRUD等功能一键生成
3、低代码图表功能,在线设计图表无需编码,实现曲线图,柱状图 , 数据报表等自定义排版布局
4、封装各种工具类 , 如定时任务,短信接口邮件发送,excel导入,文件上传下载等
5、支持查询过滤器,动态拼装SQL追加查询条件
6、实现数据权限,控制到行级,列表级,表单字段级 , 实现不同人看不同数据
7、支持SAAS服务模式,提供多租户的架构方案
8、数据库兼容主流Mysql、PostgreSql、Oracle、SQLServer、MariaDB等主流数据库,一套代码兼容主流
9、集成了Activiti工作流
10、支持单点登录CAS集成方案
11、接口统一采用restful接口方式,集成了Swagger-ui在线接口文档
技术架构:
后台环境:
Java8 Maven Mysql Redis
后台开发技术
springBoot2 SpringCloudAlibaba MybatisPlus Jimurport ApacheShir
前端:
Vue2.6 Axios
微服务架构图:
后台操作图:
支持手机端
Myeclipse中如何自动生成Java代码啊myeclipse没有直接的快捷键自动生成构造方法,可以有快捷键弹出source,接着点击自动生成构造方法的菜单 。
具体操作如下:工具里快捷键alt shift s
就弹出来Generate
Constructor
using
Fields
关于java代码一健生成和java代码生成uuid的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。

    推荐阅读