SpingBoot myBatis neo4j整合项目案例
此项目为spring boot - myBatis - neo4j数据库整合项目。
有增删改查(节点关系)、动态分页条件排序等一些示例。
git下载地址:git clone https://github.com/wsm1217395196/my-project-demo.git 项目名:springboot-mybatis-neo4j
运行此项目前请先到http://localhost:7474/browser/运行cql(确定安装了neo4j数据库)
create (u:user{name:'wsm',sex:'男',age:23}) - [l:like] -> (y:user{name:'yy',sex:'女',age:21})
pom文件依赖
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<span class="hljs-tag"><<span class="hljs-name">groupId</span>></span>springboot-neo4j-mybatis<span class="hljs-tag"></<span class="hljs-name">groupId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">artifactId</span>></span>springboot-neo4j-mybatis<span class="hljs-tag"></<span class="hljs-name">artifactId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">version</span>></span>1.0-SNAPSHOT<span class="hljs-tag"></<span class="hljs-name">version</span>></span>
<span class="hljs-tag"><<span class="hljs-name">dependencies</span>></span>
<span class="hljs-comment"><!--spring boot--></span>
<span class="hljs-tag"><<span class="hljs-name">dependency</span>></span>
<span class="hljs-tag"><<span class="hljs-name">groupId</span>></span>org.springframework.boot<span class="hljs-tag"></<span class="hljs-name">groupId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">artifactId</span>></span>spring-boot-starter-web<span class="hljs-tag"></<span class="hljs-name">artifactId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">version</span>></span>2.1.2.RELEASE<span class="hljs-tag"></<span class="hljs-name">version</span>></span>
<span class="hljs-tag"></<span class="hljs-name">dependency</span>></span>
<span class="hljs-tag"><<span class="hljs-name">dependency</span>></span>
<span class="hljs-tag"><<span class="hljs-name">groupId</span>></span>org.springframework.boot<span class="hljs-tag"></<span class="hljs-name">groupId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">artifactId</span>></span>spring-boot-starter-test<span class="hljs-tag"></<span class="hljs-name">artifactId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">scope</span>></span>test<span class="hljs-tag"></<span class="hljs-name">scope</span>></span>
<span class="hljs-tag"><<span class="hljs-name">version</span>></span>2.1.2.RELEASE<span class="hljs-tag"></<span class="hljs-name">version</span>></span>
<span class="hljs-tag"></<span class="hljs-name">dependency</span>></span>
<span class="hljs-comment"><!--org.json--></span>
<span class="hljs-tag"><<span class="hljs-name">dependency</span>></span>
<span class="hljs-tag"><<span class="hljs-name">groupId</span>></span>org.json<span class="hljs-tag"></<span class="hljs-name">groupId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">artifactId</span>></span>json<span class="hljs-tag"></<span class="hljs-name">artifactId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">version</span>></span>20180813<span class="hljs-tag"></<span class="hljs-name">version</span>></span>
<span class="hljs-tag"></<span class="hljs-name">dependency</span>></span>
<span class="hljs-comment"><!--neo4j-jdbc-driver--></span>
<span class="hljs-tag"><<span class="hljs-name">dependency</span>></span>
<span class="hljs-tag"><<span class="hljs-name">groupId</span>></span>org.neo4j<span class="hljs-tag"></<span class="hljs-name">groupId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">artifactId</span>></span>neo4j-jdbc-driver<span class="hljs-tag"></<span class="hljs-name">artifactId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">version</span>></span>3.4.0<span class="hljs-tag"></<span class="hljs-name">version</span>></span>
<span class="hljs-tag"></<span class="hljs-name">dependency</span>></span>
<span class="hljs-comment"><!--mybatis-spring-boot--></span>
<span class="hljs-tag"><<span class="hljs-name">dependency</span>></span>
<span class="hljs-tag"><<span class="hljs-name">groupId</span>></span>org.mybatis.spring.boot<span class="hljs-tag"></<span class="hljs-name">groupId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">artifactId</span>></span>mybatis-spring-boot-starter<span class="hljs-tag"></<span class="hljs-name">artifactId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">version</span>></span>2.0.1<span class="hljs-tag"></<span class="hljs-name">version</span>></span>
<span class="hljs-tag"></<span class="hljs-name">dependency</span>></span>
<span class="hljs-tag"></<span class="hljs-name">dependencies</span>></span>
<span class="hljs-tag"><<span class="hljs-name">build</span>></span>
<span class="hljs-tag"><<span class="hljs-name">plugins</span>></span>
<span class="hljs-tag"><<span class="hljs-name">plugin</span>></span>
<span class="hljs-tag"><<span class="hljs-name">groupId</span>></span>org.springframework.boot<span class="hljs-tag"></<span class="hljs-name">groupId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">artifactId</span>></span>spring-boot-maven-plugin<span class="hljs-tag"></<span class="hljs-name">artifactId</span>></span>
<span class="hljs-tag"></<span class="hljs-name">plugin</span>></span>
<span class="hljs-tag"></<span class="hljs-name">plugins</span>></span>
<span class="hljs-tag"></<span class="hljs-name">build</span>></span>
</project>
application.yml
#端口号
server:
port: 8018
spring:
application:
name: springboot-mybatis-neo4j #服务名
datasource:
driver-class-name: org.neo4j.jdbc.http.HttpDriver
name: neo4j
password: root
url: jdbc:neo4j:http://localhost:7474
mybatis:
mapper-locations: classpath:mapper/*.xml
UserMapper.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org/DTD Mapper 3.0" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.study.mapper.UserMapper">
<span class="hljs-comment"><!-- 自定义结果集--></span>
<span class="hljs-tag"><<span class="hljs-name">resultMap</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"userMap"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"com.study.model.UserModel"</span>></span>
<span class="hljs-tag"><<span class="hljs-name">id</span> <span class="hljs-attr">property</span>=<span class="hljs-string">"id"</span> <span class="hljs-attr">column</span>=<span class="hljs-string">"id"</span>/></span>
<span class="hljs-tag"><<span class="hljs-name">result</span> <span class="hljs-attr">property</span>=<span class="hljs-string">"name"</span> <span class="hljs-attr">column</span>=<span class="hljs-string">"name"</span>/></span>
<span class="hljs-tag"><<span class="hljs-name">result</span> <span class="hljs-attr">property</span>=<span class="hljs-string">"age"</span> <span class="hljs-attr">column</span>=<span class="hljs-string">"age"</span>/></span>
<span class="hljs-tag"><<span class="hljs-name">result</span> <span class="hljs-attr">property</span>=<span class="hljs-string">"sex"</span> <span class="hljs-attr">column</span>=<span class="hljs-string">"sex"</span>/></span>
<span class="hljs-tag"><<span class="hljs-name">collection</span> <span class="hljs-attr">property</span>=<span class="hljs-string">"userModels"</span> <span class="hljs-attr">ofType</span>=<span class="hljs-string">"com.study.model.UserModel"</span>></span>
<span class="hljs-tag"><<span class="hljs-name">id</span> <span class="hljs-attr">property</span>=<span class="hljs-string">"id"</span> <span class="hljs-attr">column</span>=<span class="hljs-string">"id1"</span>/></span>
<span class="hljs-tag"><<span class="hljs-name">result</span> <span class="hljs-attr">property</span>=<span class="hljs-string">"name"</span> <span class="hljs-attr">column</span>=<span class="hljs-string">"name1"</span>/></span>
<span class="hljs-tag"><<span class="hljs-name">result</span> <span class="hljs-attr">property</span>=<span class="hljs-string">"age"</span> <span class="hljs-attr">column</span>=<span class="hljs-string">"age1"</span>/></span>
<span class="hljs-tag"><<span class="hljs-name">result</span> <span class="hljs-attr">property</span>=<span class="hljs-string">"sex"</span> <span class="hljs-attr">column</span>=<span class="hljs-string">"sex1"</span>/></span>
<span class="hljs-tag"></<span class="hljs-name">collection</span>></span>
<span class="hljs-tag"></<span class="hljs-name">resultMap</span>></span>
<span class="hljs-comment"><!--这里CQL语句返回的字段名必须与上面定义的结果集的字段名一致,若不一致需要重命名,否则会报空指针异常 --></span>
<span class="hljs-tag"><<span class="hljs-name">select</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"getPage"</span> <span class="hljs-attr">resultMap</span>=<span class="hljs-string">"userMap"</span>></span>
match (u:user)
<span class="hljs-tag"><<span class="hljs-name">where</span>></span>
<span class="hljs-tag"><<span class="hljs-name">if</span> <span class="hljs-attr">test</span>=<span class="hljs-string">"name != null and name != ''"</span>></span>
u.name =~ #{name}
<span class="hljs-tag"></<span class="hljs-name">if</span>></span>
<span class="hljs-tag"><<span class="hljs-name">if</span> <span class="hljs-attr">test</span>=<span class="hljs-string">"sex != null and sex != ''"</span>></span>
and u.sex = #{sex}
<span class="hljs-tag"></<span class="hljs-name">if</span>></span>
<span class="hljs-tag"></<span class="hljs-name">where</span>></span>
return
id(u) as id,u.name as name,u.age as age,u.sex as sex
<span class="hljs-tag"><<span class="hljs-name">if</span> <span class="hljs-attr">test</span>=<span class="hljs-string">"sort != null and sort != ''"</span>></span>
order by ${sort}
<span class="hljs-tag"></<span class="hljs-name">if</span>></span>
<span class="hljs-tag"><<span class="hljs-name">if</span> <span class="hljs-attr">test</span>=<span class="hljs-string">"pageStart >= 0 and pageSize > 0"</span>></span>
skip #{pageStart} limit #{pageSize}
<span class="hljs-tag"></<span class="hljs-name">if</span>></span>
<span class="hljs-tag"></<span class="hljs-name">select</span>></span>
<span class="hljs-tag"><<span class="hljs-name">select</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"getPageTotal"</span> <span class="hljs-attr">resultType</span>=<span class="hljs-string">"int"</span>></span>
match (u:user)
<span class="hljs-tag"><<span class="hljs-name">where</span>></span>
<span class="hljs-tag"><<span class="hljs-name">if</span> <span class="hljs-attr">test</span>=<span class="hljs-string">"name != null and name != ''"</span>></span>
u.name =~ #{name}
<span class="hljs-tag"></<span class="hljs-name">if</span>></span>
<span class="hljs-tag"><<span class="hljs-name">if</span> <span class="hljs-attr">test</span>=<span class="hljs-string">"sex != null and sex != ''"</span>></span>
and u.sex = #{sex}
<span class="hljs-tag"></<span class="hljs-name">if</span>></span>
<span class="hljs-tag"></<span class="hljs-name">where</span>></span>
return count(*)
<span class="hljs-tag"></<span class="hljs-name">select</span>></span>
<span class="hljs-tag"><<span class="hljs-name">select</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"getAll"</span> <span class="hljs-attr">resultMap</span>=<span class="hljs-string">"userMap"</span>></span>
match
(u:user)
return
id(u) as id,u.name as name,u.age as age,u.sex as sex
<span class="hljs-tag"></<span class="hljs-name">select</span>></span>
<span class="hljs-tag"><<span class="hljs-name">select</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"getById"</span> <span class="hljs-attr">resultMap</span>=<span class="hljs-string">"userMap"</span>></span>
match
(u:user)- [l:like] -> (u1:user)
where
id(u) = #{id}
return
id(u) as id,u.name as name,u.age as age,u.sex as sex,
id(u1) as id1,u1.name as name1,u1.age as age1,u1.sex as sex1
<span class="hljs-tag"></<span class="hljs-name">select</span>></span>
<span class="hljs-tag"><<span class="hljs-name">insert</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"add"</span>></span>
create(u:user{name:#{model.name},age:#{model.age},sex:#{model.sex}})
<span class="hljs-tag"></<span class="hljs-name">insert</span>></span>
<span class="hljs-tag"><<span class="hljs-name">update</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"update"</span>></span>
match (u:user)
where id(u) = #{model.id}
set u.name = #{model.name},u.age = #{model.age},u.sex = #{model.sex}
<span class="hljs-tag"></<span class="hljs-name">update</span>></span>
<span class="hljs-tag"><<span class="hljs-name">delete</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"deleteById"</span>></span>
match (u:user) where id(u) = #{id} delete u
<span class="hljs-tag"></<span class="hljs-name">delete</span>></span>
</mapper>
UserMapper接口
package com.study.mapper;
import com.study.model.UserModel;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface UserMapper {
<span class="hljs-built_in">List</span><UserModel> getPage(<span class="hljs-meta">@Param</span>(<span class="hljs-string">"pageStart"</span>) <span class="hljs-built_in">int</span> pageStart, <span class="hljs-meta">@Param</span>(<span class="hljs-string">"pageSize"</span>) <span class="hljs-built_in">int</span> pageSize, <span class="hljs-meta">@Param</span>(<span class="hljs-string">"sort"</span>) <span class="hljs-built_in">String</span> sort, <span class="hljs-meta">@Param</span>(<span class="hljs-string">"name"</span>) <span class="hljs-built_in">String</span> name, <span class="hljs-meta">@Param</span>(<span class="hljs-string">"sex"</span>) <span class="hljs-built_in">String</span> sex);
<span class="hljs-built_in">int</span> getPageTotal(<span class="hljs-meta">@Param</span>(<span class="hljs-string">"name"</span>) <span class="hljs-built_in">String</span> name, <span class="hljs-meta">@Param</span>(<span class="hljs-string">"sex"</span>) <span class="hljs-built_in">String</span> sex);
<span class="hljs-built_in">List</span><UserModel> getAll();
UserModel getById(<span class="hljs-meta">@Param</span>(<span class="hljs-string">"id"</span>) Long id);
<span class="hljs-built_in">int</span> add(<span class="hljs-meta">@Param</span>(<span class="hljs-string">"model"</span>) UserModel model);
<span class="hljs-built_in">int</span> update(<span class="hljs-meta">@Param</span>(<span class="hljs-string">"model"</span>) UserModel model);
<span class="hljs-built_in">int</span> deleteById(<span class="hljs-meta">@Param</span>(<span class="hljs-string">"id"</span>) Long id);
}
userModel实体类
package com.study.model;
import java.util.List;
public class UserModel {
<span class="hljs-keyword">private</span> Long id;
<span class="hljs-keyword">private</span> String name;
<span class="hljs-keyword">private</span> Integer age;
<span class="hljs-keyword">private</span> String sex;
<span class="hljs-keyword">private</span> List<UserModel> userModels;
<span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">getId</span><span class="hljs-params">()</span> </span>{
<span class="hljs-keyword">return</span> id;
}
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">setId</span><span class="hljs-params">(Long id)</span> </span>{
<span class="hljs-keyword">this</span>.id = id;
}
<span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">getName</span><span class="hljs-params">()</span> </span>{
<span class="hljs-keyword">return</span> name;
}
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">setName</span><span class="hljs-params">(String name)</span> </span>{
<span class="hljs-keyword">this</span>.name = name;
}
<span class="hljs-function"><span class="hljs-keyword">public</span> Integer <span class="hljs-title">getAge</span><span class="hljs-params">()</span> </span>{
<span class="hljs-keyword">return</span> age;
}
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">setAge</span><span class="hljs-params">(Integer age)</span> </span>{
<span class="hljs-keyword">this</span>.age = age;
}
<span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">getSex</span><span class="hljs-params">()</span> </span>{
<span class="hljs-keyword">return</span> sex;
}
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">setSex</span><span class="hljs-params">(String sex)</span> </span>{
<span class="hljs-keyword">this</span>.sex = sex;
}
<span class="hljs-function"><span class="hljs-keyword">public</span> List<UserModel> <span class="hljs-title">getUserModels</span><span class="hljs-params">()</span> </span>{
<span class="hljs-keyword">return</span> userModels;
}
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">setUserModels</span><span class="hljs-params">(List<UserModel> userModels)</span> </span>{
<span class="hljs-keyword">this</span>.userModels = userModels;
}
}
UserController控制器
package com.study.controller;
import com.study.mapper.UserMapper;
import com.study.model.UserModel;
import com.study.result.PageParam;
import com.study.result.PageResult;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/user")
public class UserController {
<span class="hljs-meta">@Autowired</span>
<span class="hljs-keyword">private</span> UserMapper userMapper;
<span class="hljs-comment">/**
* 分页条件查询
* 参数例:{"pageIndex":1,"pageSize":2,"sort":"u.sex desc","condition":"{'name':'','sex':'男'}"}
*
* <span class="hljs-doctag">@param</span> pageParam
* <span class="hljs-doctag">@return</span>
*/</span>
<span class="hljs-meta">@PostMapping</span>(<span class="hljs-string">"/getPage"</span>)
<span class="hljs-function"><span class="hljs-keyword">public</span> PageResult <span class="hljs-title">getPage</span><span class="hljs-params">(@RequestBody PageParam pageParam)</span> </span>{
<span class="hljs-keyword">int</span> pageStart = pageParam.getPageStart();
<span class="hljs-keyword">int</span> pageIndex = pageParam.getPageIndex();
<span class="hljs-keyword">int</span> pageSize = pageParam.getPageSize();
String sort = pageParam.getSort();
JSONObject jsonObject = <span class="hljs-keyword">new</span> JSONObject(pageParam.getCondition());
String name = <span class="hljs-string">".*"</span> + jsonObject.getString(<span class="hljs-string">"name"</span>) + <span class="hljs-string">".*"</span>; <span class="hljs-comment">//模糊查询</span>
String sex = jsonObject.getString(<span class="hljs-string">"sex"</span>);
List<UserModel> models = userMapper.getPage(pageStart, pageSize, sort, name, sex);
<span class="hljs-keyword">int</span> total = userMapper.getPageTotal(name, sex);
PageResult pageResult = <span class="hljs-keyword">new</span> PageResult(pageIndex, pageSize, total, models);
<span class="hljs-keyword">return</span> pageResult;
}
<span class="hljs-meta">@GetMapping</span>(<span class="hljs-string">"/getAll"</span>)
<span class="hljs-function"><span class="hljs-keyword">public</span> List<UserModel> <span class="hljs-title">getAll</span><span class="hljs-params">()</span> </span>{
List<UserModel> models = userMapper.getAll();
<span class="hljs-keyword">return</span> models;
}
<span class="hljs-comment">/**
* 根据id查询(含节点关系)
*
* <span class="hljs-doctag">@param</span> id
* <span class="hljs-doctag">@return</span>
*/</span>
<span class="hljs-meta">@GetMapping</span>(<span class="hljs-string">"/getById/{id}"</span>)
<span class="hljs-function"><span class="hljs-keyword">public</span> UserModel <span class="hljs-title">getById</span><span class="hljs-params">(@PathVariable Long id)</span> </span>{
UserModel model = userMapper.getById(id);
<span class="hljs-keyword">return</span> model;
}
<span class="hljs-meta">@PostMapping</span>(<span class="hljs-string">"/add"</span>)
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">int</span> <span class="hljs-title">add</span><span class="hljs-params">(@RequestBody UserModel model)</span> </span>{
<span class="hljs-keyword">int</span> i = userMapper.add(model);
<span class="hljs-keyword">return</span> i;
}
<span class="hljs-meta">@PostMapping</span>(<span class="hljs-string">"/update"</span>)
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">int</span> <span class="hljs-title">update</span><span class="hljs-params">(@RequestBody UserModel model)</span> </span>{
<span class="hljs-keyword">int</span> i = userMapper.update(model);
<span class="hljs-keyword">return</span> i;
}
<span class="hljs-meta">@DeleteMapping</span>(<span class="hljs-string">"/deleteById/{id}"</span>)
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">int</span> <span class="hljs-title">deleteById</span><span class="hljs-params">(@PathVariable Long id)</span> </span>{
<span class="hljs-keyword">int</span> i = userMapper.deleteById(id);
<span class="hljs-keyword">return</span> i;
}
}
要用分页条件查询请到git 上复制 PageResult,PageParam类。
最后在入口类记得加上扫描mapper接口@MapperScan(“com.study.mapper”)
原文地址:https://blog.csdn.net/WSM960921/article/details/95076242 </div>
SpingBoot myBatis neo4j整合项目案例的更多相关文章
- SSM(Spring,SpringMVC,Mybatis)框架整合项目
快速上手SSM(Spring,SpringMVC,Mybatis)框架整合项目 环境要求: IDEA MySQL 8.0.25 Tomcat 9 Maven 3.6 数据库环境: 创建一个存放书籍数据 ...
- Spring3 + Spring MVC+ Mybatis 3+Mysql 项目整合(注解及源码)
Spring3 + Spring MVC+ Mybatis 3+Mysql 项目整合(注解及源码) 备注: 之前在Spring3 + Spring MVC+ Mybatis 3+Mysql 项目整合中 ...
- Mybatis入门之MyBatis项目案例
一.项目案例演示 后台管理系统用户数据维护平台 所有用户数据查询 单个用户数据查询 用户数据修改(完善资料) 锁定用户账号 删除用户账号 彻底删除用户账号 二.数据库数据准备工作 数据库:mysql ...
- Mybatis、maven项目中整合log4j (17)
Mybatis.maven项目总整合log4j java 中Mybatis.maven项目总整合log4j 1.pom增加log4j包引用 2.添加 log4j.properties文件 # java ...
- Spring+SpringMVC+MyBatis+easyUI整合优化篇(二)Log4j讲解与整合
日常啰嗦 上一篇文章主要讲述了一下syso和Log间的一些区别与比较,重点是在项目的日志功能上,因此,承接前文<Spring+SpringMVC+MyBatis+easyUI整合优化篇(一)Sy ...
- Spring+SpringMVC+MyBatis+easyUI整合优化篇(十三)数据层优化-表规范、索引优化
本文提要 最近写的几篇文章都是关于数据层优化方面的,这几天也在想还有哪些地方可以优化改进,结合日志和项目代码发现,关于数据层的优化,还是有几个方面可以继续修改的,代码方面,整合了druid数据源也开启 ...
- Spring+SpringMVC+MyBatis+easyUI整合进阶篇(一)设计一套好的RESTful API
写在前面的话 看了一下博客目录,距离上次更新这个系列的博文已经有两个多月,并不是因为不想继续写博客,由于中间这段时间更新了几篇其他系列的文章就暂时停止了,如今已经讲述的差不多,也就继续抽时间更新< ...
- Spring+SpringMVC+MyBatis+easyUI整合进阶篇(六)一定要RESTful吗?
作者:13 GitHub:https://github.com/ZHENFENG13 版权声明:本文为原创文章,未经允许不得转载. 写在前面的话 这个问题看起来就显得有些萌,或者说类似的问题都有些不靠 ...
- Spring+SpringMVC+MyBatis+easyUI整合进阶篇(七)一次线上Mysql数据库崩溃事故的记录
作者:13 GitHub:https://github.com/ZHENFENG13 版权声明:本文为原创文章,未经允许不得转载. 文章简介 工作这几年,技术栈在不断更新,项目管理心得也增加了不少,写 ...
随机推荐
- JS实用插件
1. jQuery鼠标滚轮事件插件Mouse Wheel 下载链接:https://github.com/brandonaaron/jquery-mousewheel/ 使用方法: // using ...
- C++面向对象高级编程(下)-Geekband
11, 组合和继承 一, Composition 复合 has-a的关系 简单来讲, 就是: class A{ classB b1; }; 这里讲到Adapter设计模式: templa ...
- [转]使用RDLC报表
使用RDLC报表(一) 1 建立数据源 启动VS2005新建一个窗体项目,命名为TestProj 在左边的窗体内选择“添加新数据源”或在菜单上操作“添加新数据源”: 选择后出现对话窗体,选 ...
- vue 学习 二
动画 <transition name="fade"> <p v-if="show">hello</p> </tran ...
- 一维、二维数组 与 常用的返回数组 以及 fetch_all与fetch_row的区别
一维数组:单行单列的数组. 二维数组:多行多列的数组. (至少两行两列) 索引数组: fetch_all() 返回所有数组 fetch_row() 返回一行或一列数组 (第二行需要输入两 ...
- 《DSP using MATLAB》Problem 7.29
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- HDFS写数据的过程
- springmvc:配置解决中文乱码的过滤器
在web.xml中配置以下内容: <!--配置解决中文乱码过滤器--> <filter> <filter-name>characterEncodingFilter& ...
- Luogu P1092 虫食算(枚举+剪枝)
P1092 虫食算 题面 题目描述 所谓虫食算,就是原先的算式中有一部分被虫子啃掉了,需要我们根据剩下的数字来判定被啃掉的字母.来看一个简单的例子: 43#9865#045 + 8468#6633 4 ...
- IDEA javax.servlet.http.HttpServletRequest; 不存在 解决方案
使用idea创建一个web项目,在项目中报HttpServletRequest和HttpServletResponse不存在. 问题原因:idea不会默认引用tomcat的jar包. 解决方法: [注 ...